Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const int M=3;
- const int N=4;
- int pole[M][N], x=0, y=0, i=0;
- string str;
- char *cstr, *pm;
- cstr= new char [str.size()+1];
- ifstream file("file.txt");
- while (getline(file,str,'\n'))
- {
- strcpy(cstr,str.c_str());
- pm=strtok(cstr," ");
- while (pm!=NULL)
- {
- i=atoi(pm);
- pole[x][y]=i;
- y++;
- pm=strtok(NULL," ");
- }
- x++;
- }
- tisk(pole);
Add Comment
Please, Sign In to add comment