View Single Post
  #3 (permalink)  
Old 10-01-2006, 03:57 PM
WingedPanther's Avatar   
WingedPanther WingedPanther is offline
Super Moderator
 
Join Date: Jul 2006
Age: 35
Posts: 4,092
Last Blog:
Why Learn Data Structu...
Credits: 28
Rep Power: 45
WingedPanther is a splendid one to beholdWingedPanther is a splendid one to beholdWingedPanther is a splendid one to beholdWingedPanther is a splendid one to beholdWingedPanther is a splendid one to beholdWingedPanther is a splendid one to beholdWingedPanther is a splendid one to behold
Default

Quote:
Originally Posted by Saint View Post
I'm using g++ in Redhat linux and I have code like this:

Code:
#include <iostream>

int main()
{

cout << "Hello World!";
return 0;
}
but I get a count undeclared. Does iostream not have cout in it?
Your error is probably "cout undeclared". cout is located in the std namespace, so your coude needs to either be
Code:
#include <iostream>

int main()
{

std::cout << "Hello World!";
return 0;
}
or

Code:
#include <iostream>

using std::cout;
int main()
{

cout << "Hello World!";
return 0;
}
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum
Programming is a branch of mathematics.
Reply With Quote