Thread: clearing output buffer?

  1. #1
    Registered User
    Join Date
    Nov 2006
    Posts
    86

    clearing output buffer?

    Code:
    int main ()
    {
      int x = 100;
    
    
      cout << showbase << setbase(16) << x << endl;
    
    
    
      cout << setbase(16) << x << endl;
    }
    what i want is, for the second cout to print x as 64 instead of 0x64...

    how do i "clear" the command from the above cout ?

    sry for bad english :P


    oh, i finished my book about the basics of cpp...
    and ehm, i want make programs that have some GUI and comunicate with windows...

    can you guys advice me some books on gui and windows programming ?
    Last edited by epidemic; 01-04-2007 at 06:32 PM.

  2. #2
    Registered User
    Join Date
    Jan 2005
    Posts
    7,366
    >> how do i "clear" the command from the above cout
    Use noshowbase.

  3. #3
    Registered User
    Join Date
    Nov 2006
    Posts
    86
    eh lol... ty :P

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Lame null append cause buffer to crash
    By cmoo in forum C Programming
    Replies: 8
    Last Post: 12-29-2008, 03:27 AM
  2. feed printf output into buffer
    By MK27 in forum C Programming
    Replies: 4
    Last Post: 07-11-2008, 08:00 AM
  3. Returning addresses, buffer not clearing
    By Iconate in forum C Programming
    Replies: 2
    Last Post: 04-07-2008, 01:18 PM
  4. Going from single-threaded to multi-threaded
    By Dino in forum C Programming
    Replies: 11
    Last Post: 03-23-2008, 01:14 PM
  5. Replies: 16
    Last Post: 10-29-2006, 05:04 AM