Prog_
asked on
#include ?
Why when I use #include <iostream.h> everything is fine... it prints "Hello World"
But if I use #include <iostream> it prints numbers probably an Address ?
#include <afxwin.h>
#include <iostream> // problem
int main()
{
CString s1("Hello World");
std::cout << s1;
return 0;
}
But if I use #include <iostream> it prints numbers probably an Address ?
#include <afxwin.h>
#include <iostream> // problem
int main()
{
CString s1("Hello World");
std::cout << s1;
return 0;
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
<iostream> is pure STL, and doesn't know anything about MFC classes like CString. And CString doesn't have an operator<< for cout. But you should be able to cast it to do what you want:
CString s1("Hello World");
std::cout << (LPCTSTR) s1;