• Advertisement

Archived

This topic is now archived and is closed to further replies.

CString from a file

This topic is 5497 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am using ifstream to get some text taht I am willing to put in a CString... but I get an error : c:\documents and settings\sebdes\desktop\projetsp_1_3\mainfrm.cpp(1581) : error C2678: binary '>>' : no operator defined which takes a left-hand operand of type 'class ifstream' (or there is no acceptable conversion) my code line is : inFile >> Menu1[iCpt].Texte; This is the type of the Texte variable: CString Texte; it works fine with binary stuff but not for text... what am I doing wrong Thankx [edited by - FreezeRrR on February 6, 2003 7:48:59 PM]

Share this post


Link to post
Share on other sites
Advertisement
iostreams only overload >> for strings. so, make a temporary string, read whatever you wish into it, and construct CString from that string.

Share this post


Link to post
Share on other sites

  • Advertisement