Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <string>
- #include <windows.h>
- #include <sstream>
- using namespace std;
- int main()
- {
- int col, row;
- row = 0;
- col = 0;
- //table [row][col];
- string table [6][2];
- fstream InFile;
- InFile.open("test.txt", ios::in | ios::out);
- string line;
- while(getline(InFile, line))
- {
- row++;
- stringstream s(line);
- string token;
- while(getline(s, token, ' '))
- {
- col++;
- table[row][col];
- }
- }
- cout <<"Rows: "<< row << endl;
- cout<<"Columns: "<< col/row <<endl;
- cout<<table[1][2];
- InFile.close();
- }
Add Comment
Please, Sign In to add comment