Thread: Yo son, whats the deal with cerr << " "; ?

  1. #1
    Registered User
    Join Date
    Apr 2002
    Posts
    156

    Yo son, whats the deal with cerr << " "; ?

    What exactly does it do really?

    in C its like:
    fprintf(stderr, "Couldn't upload image %s: %s", filename, SDL_GetError());

    In a chatroom someone told that the C++ equivilant is:

    cerr << "Couldn't upload image " << filename << ": " << SDL_GetError();

    Some questions.
    Is it possible to use some C++ coding in the SDL graphic library?
    What is the difference between cerr and cout? if any?
    Compiler: MingW(IDE: Bloodshed Dev-C++ 4.01)
    Web Site: Zoo Crew
    Forums: Zoo Boards
    E-mail: [email protected]

    "Do you wanna go to jail or do you wanna go home?!?!" - Alonzo(Training Day)

  2. #2
    geek SilentStrike's Avatar
    Join Date
    Aug 2001
    Location
    NJ
    Posts
    1,141
    BomberLAN is written in C++ and uses SDL. cerr prints stuff to stderr, cout prints stuff to stdout.
    Prove you can code in C++ or C# at TopCoder, referrer rrenaud
    Read my livejournal

  3. #3
    Registered User
    Join Date
    Apr 2002
    Posts
    156
    ok, so console output is impossible in SDL?
    Compiler: MingW(IDE: Bloodshed Dev-C++ 4.01)
    Web Site: Zoo Crew
    Forums: Zoo Boards
    E-mail: [email protected]

    "Do you wanna go to jail or do you wanna go home?!?!" - Alonzo(Training Day)

  4. #4
    geek SilentStrike's Avatar
    Join Date
    Aug 2001
    Location
    NJ
    Posts
    1,141
    It's easy actually. I don't know what compiler you are using (console output works by default in gcc/linux). If you are using MSVC, you need to change the subsystem line in the project options to console.
    Prove you can code in C++ or C# at TopCoder, referrer rrenaud
    Read my livejournal

  5. #5
    Registered User
    Join Date
    Apr 2002
    Posts
    156
    I'm using Dev-C++4
    Compiler: MingW(IDE: Bloodshed Dev-C++ 4.01)
    Web Site: Zoo Crew
    Forums: Zoo Boards
    E-mail: [email protected]

    "Do you wanna go to jail or do you wanna go home?!?!" - Alonzo(Training Day)

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Simple Processes Program
    By khdani in forum Linux Programming
    Replies: 9
    Last Post: 11-18-2008, 10:59 AM
  2. 1337 bible, Gen 11
    By Paz_Rax in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 05-20-2005, 09:40 PM