Starting out, and don't understand this
Im reading Sams Teach Yourself C++ in 21 Days. Its a good book so far I think. But I think he wrote something wrong.
I am typing in the code exactly as soon on page 18:
And I get the following errors:
std:cout << "Hello World!\n";
std::cin >> x;
--------------------Configuration: Example1 - Win32 Debug--------------------
c:\program files\microsoft visual studio\myprojects\example1\ex1.cpp(5) : error C2065: 'cout' : undeclared identifier
c:\program files\microsoft visual studio\myprojects\example1\ex1.cpp(5) : error C2297: '<<' : illegal, right operand has type 'char '
Error executing cl.exe.
Example1.exe - 2 error(s), 0 warning(s)
Can anyone tell me what is wrong? I copied it exactly out of the book. Im using Microsoft Visual C++ 6.0
If you need any other info let me know, thanks in advance to anyone that helps me out.
You can download the source code.
First, it's a really good idea to hand-type in all of the example programs. But, you can download the source code at the author's website. I had to do this a couple of times when I couldn't see my typo.