Hi SarwanGul,
your code looks a little weird right now.
let me see if i got your problem right.
you have a file (say 'def.txt') which consits of two numbers seperated by a ','.
[def.txt]
123,456
or
[def.txt]
12.34,56.78
you like to read this numbers and store them to two variables (lets say two double vars).
is this correct??
if so
you should
- open the file for reading (you did this, but the return value of Open func is not a CString but a BOOL telling you if the open was successful)
- read the line to a string(you have to decide if you like to use MFC obejcts and functions -CFile, CString etc.- or the C++ specific string and iostream rountines)
- split the string and assign numbers to values
need any help with this??
leflon
Main Topics
Browse All Topics





by: AlexFMPosted on 2004-04-16 at 12:02:35ID: 10845183
Use CStdioFile class and CStdioFile::ReadString function:
BOOL ReadString(CString& rString);
Having CString variable use sscanf to read two int variables from it.