i know this isn’t an sdl question, but i can’t find a best forum than that
to ask programming questions.
ok here it is: i have the g++ 3.* i #include the but the comiler
can’t find the definition of cout.
why is that? thanks a lot_________________________________________________________________
The new MSN 8: smart spam protection and 2 months FREE*
http://join.msn.com/?page=features/junkmail
#include
using namespace std;
int main (int argc, char **argv) {
cout << “Hello, World !” << endl;
}On Saturday 08 November 2003 17:58, david roguin wrote:
ok here it is: i have the g++ 3.* i #include the but the comiler
can’t find the definition of cout.
Hi!
cout is defined within the namespace std so you will have to:
std::cout << “Hello World” << std::endl;
or:
using namespace std;
cout << “Hello World” << endl;
I prefer the std::cout way…
david roguin wrote:> i know this isn’t an sdl question, but i can’t find a best forum than
that to ask programming questions.
ok here it is: i have the g++ 3.* i #include the but the
comiler can’t find the definition of cout.
why is that? thanks a lot
The new MSN 8: smart spam protection and 2 months FREE*
http://join.msn.com/?page=features/junkmail
SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl
i know this isn’t an sdl question, but i can’t find
a best forum than that
to ask programming questions.
My favorite forum for this stuff can be found at
http://www.gamedev.net/ (they have non-game-specific
forum areas too).
ok here it is: i have the g++ 3.* i #include the
but the comiler
can’t find the definition of cout.
why is that? thanks a lot
Others have allready answered ^_^.
(also, I prefer to use tokens when I need them:
#include
using std::endl; //used a lot everywhere
void funca (void)
{
using std::cout; //used a lot in this function
cout << “This is the” << endl;
cout << " function that uses" << endl;
cout << " std::cout a lot." << endl;
}
void funcb (void)
{
//only used cout a little:
std::cout << “This only uses cout a little bit” <<
endl;
}
int main( … )
{
using std::cout;
using std::flush;
cout << "Function A: " << flush;
funca();
cout << "Function B: " << flush;
funcb();
}
// -Mike__________________________________
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree