Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

the mystery of streams

Status
Not open for further replies.

AMosmann

Programmer
May 27, 2003
82
DE
Can anyone give me a way how to use streams?

I program MVC++ for 2 month, used streams from time to time but:

sometimes the compiler doesnt find the functions (no matching overlad ...) seems it depends on the sequence of the includes

now I try to use >> operator with strings like stream >> cstring.GetBuffer(cstring.GetLength()) and it doesnt write into the file (in spite of close)

everytime I use the help there is nearly nothing explained

Can you tell me a plainly direction how to use streams (and CStrings with them?)

Many thanks, I hate blind trying with lots of possibilities

Greetings Andreas
 
I'll start by saying that the stream classes are a part of the standard C++ library, while CString is a part of MFC. They just don't work together very well. I advise you to go with std::basic_string<TCHAR> intstead.

But if you really want to use CString, you'd have to read using istream::read.

I REALLY hope that helps.
Will
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top