[SDL] where is defined cout?

Michael Rickert mrickert85 at yahoo.com
Sat Nov 8 18:15:01 PST 2003


> 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
> <iostream> 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 <iostream>
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




More information about the SDL mailing list