Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <string>
- #include <vector>
- #include <queue>
- using namespace std;
- vector <string> processed_lines;
- vector <string> read_file(string filename) {
- vector<string> lines;
- fstream file;
- file.open(filename.c_str(), fstream::in);
- while(!file.eof()) {
- string line;
- getline(file, line);
- lines.push_back(line);
- }
- return lines;
- }
- vector <string> split(string line) {
- vector <string> tokens;
- int pos = line.find(" ");
- while(pos!=-1) {
- tokens.push_back(line.substr(0, pos));
- line.erase(0, pos+1);
- pos = line.find(" ");
- }
- tokens.push_back(line);
- for(int i=0;i<tokens.size();i++) {
- cout<<tokens[i]<<endl;
- }
- return tokens;
- }
- int main() {
- vector <string> lines = read_file("input.c");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement