to read a file into an array
C / C++ / MFC
3
Posts
3
Posters
0
Views
1
Watching
-
please tell me how can i read a data file into an array line by line for e.g i have bob 123 mike 456
use
CStdioFile
andCStdioFile::ReadString
to read one file, and a nicewhile
loop to read each line; put each line that you read into astd::vector<CString >
. If you need to split each line into section (name and number), then you will need to use something likestrtok
. goood luck.Watched code never compiles.
-
please tell me how can i read a data file into an array line by line for e.g i have bob 123 mike 456