How to read a set of numbers from a textfile to a 2D array?
-
Hi, I need to read 5 rows by 5 columns of numbers from a text file into a 2D integer array. How do I do it in C++? e.g 10101 00011 10111 01110 10010 I've already created a 2D array and the necessary statements which are used to read from a text file. i.e int data[5][5]; ifstream inClientFile("Data.txt", ios::in);
-
Hi, I need to read 5 rows by 5 columns of numbers from a text file into a 2D integer array. How do I do it in C++? e.g 10101 00011 10111 01110 10010 I've already created a 2D array and the necessary statements which are used to read from a text file. i.e int data[5][5]; ifstream inClientFile("Data.txt", ios::in);
first read all data in any string then reterive useful text from it!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief and You
-
first read all data in any string then reterive useful text from it!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief and You
And it seems he needs to convert string to int
atoi
:)_**
**_
WhiteSky