Created
May 30, 2014 18:01
-
-
Save spundun/c91c07d7b8233e675d2e to your computer and use it in GitHub Desktop.
iostream vs fstream
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(1..1000000).each do | |
puts "12345" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <ctime> | |
#include <iostream> | |
#include <vector> | |
using namespace std; | |
int main(){ | |
vector<int> data; | |
int input; | |
while (cin >> input) | |
{ | |
data.push_back(input); | |
} | |
cout << "Data loaded." << endl; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <ctime> | |
#include <iostream> | |
#include <fstream> | |
#include <vector> | |
using namespace std; | |
int main(int argc, char *argv[]){ | |
vector<int> data; | |
int input; | |
ifstream in; | |
cout << argv[1]; | |
in.open(argv[1]); | |
while (in >> input) | |
{ | |
data.push_back(input); | |
} | |
cout << "Data loaded." << endl; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment