quote:
Original post by Anonymous Poster
CString is part of the STL not MFC isnt it ?
Good - God NO! The popular CString is part of MFC, though I''m sure CString implementations are abound.
The C++ headers that end with a .h are deprecated, they pre-date the standard and are maintained for backwards compatibility. The standard headers have no extention.
The problem is, C++ is a moving target, and you''re aiming at it''s previous location. I''m willing to bet that both the book and the compiler are dated (kinda like programming for Java 1.5 using 1.0 material & tools).
Try picking up "Accelerated C++" (red book, yellow lettering I believe).
#include with quotes tells it to look in the local directory/path - #include with angle brackets <> tells it to look in the library paths set in the IDE environment (Tools->Options).
#include <string> #include <iostream> #include <sstream>#include <complex>int main(){std::string str;using namespace std;//now we don''t have to type std:: to//access items in the std namespacestr = "Hello World!";cout << str << endl;//srting streams are useful toostd::stringstream ss;int i = 12;double d = 3.14159265358979;std::complex<float> z(.707f, .866f);ss << "This is a string stream.\nIt let''s you pipe stuff into a ";ss << "string buffer\n";ss << typeid(i).name()<<":\t"<<i<<"\n";ss << typeid(d).name()<<":\t"<<d<<"\n";ss << typeid(z).name()<<":\t"<<z<<"\n";//.str() on a string stream gives you a std::string&//that''s a std::string reference//references in C++ can''t be null*cout << ss.str();system("pause");return 0;}
*If you try really hard you can force one to be null, but they''re not ever suppose to be null.
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara