Clearing a Character

This is a discussion on Clearing a Character within the C++ Programming forums, part of the General Programming Boards category; as a Noobie programmer I was messing with C++ and was wondering if thier was a way to get a ...

  1. #1
    Registered User Vamslay1415's Avatar
    Join Date
    Sep 2005
    Posts
    4

    Clearing a Character

    as a Noobie programmer I was messing with C++ and was wondering if thier was a way to get a few dots that I have before I clear a screen to disapear and then loop.

    Code:
    int n()
    {
    cout << "\n Say good bye!\a";
    cout << "\n\nClearing Screen\a";
    cout << ".\a";
    cout << ".\a";
    cout << ".\a";
    cout << ".\a";
    cout << ".\a";
    cout << ".\a";
    cout << ".\a";
    cout << ".\a";
    cout << ".\a";
    cout << ".\a";
    cout << ".\a";
    system("cls");
    main();
    }
    that apears as

    Say good bye!

    Clearing Screen...........
    and each "." apears like a normal loading screen. What I want it to do is to have the dots disapear and start over atleast once.

  2. #2
    Registered User Tonto's Avatar
    Join Date
    Jun 2005
    Location
    New York
    Posts
    1,465
    You could print \b's (backspaces). You could change the buffer entirely, print a \r (control return) and re-print it. On windows, you could look into the ::FileConsoleOutputCharacter(..) console API. I dunno, lots of solutions, all are a bit quirky and hackish, but it's all in good fun of seeing your program have a nifty oscillating elipses (aka: useless).

  3. #3
    Registered User Vamslay1415's Avatar
    Join Date
    Sep 2005
    Posts
    4
    Alright I'll try the "\b" Thanks.

    --edit--

    Combining that with spaces then more \b worked great thanks. Thats just want I wanted it to do.
    Last edited by Vamslay1415; 09-24-2005 at 12:57 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. character set translation
    By password636 in forum C Programming
    Replies: 1
    Last Post: 06-08-2009, 11:45 AM
  2. sorting number
    By Leslie in forum C Programming
    Replies: 8
    Last Post: 05-20-2009, 04:23 AM
  3. Character literals incorrectly interpreted
    By DL1 in forum C Programming
    Replies: 11
    Last Post: 04-05-2009, 05:35 PM
  4. wide character (unicode) and multi-byte character
    By George2 in forum Windows Programming
    Replies: 6
    Last Post: 05-05-2007, 12:46 AM
  5. <string> to LPCSTR? Also, character encoding: UNICODE vs ?
    By Kurisu33 in forum C++ Programming
    Replies: 7
    Last Post: 10-09-2006, 12:48 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21