Clearing the screen.

This is a discussion on Clearing the screen. within the C++ Programming forums, part of the General Programming Boards category; Hey Guys, i did search this topic before posting this but all i could find was stuff about system("cls") or ...

  1. #1
    Registered User
    Join Date
    Aug 2011
    Posts
    9

    Clearing the screen.

    Hey Guys, i did search this topic before posting this but all i could find was stuff about system("cls") or some variation on that, i did try it but it seems my compiler (code::blocks) doesn't allow it.

    I tried using this also.

    Code:
    for (int i = 0; i < 10; i++)
    {
    
    cout<<"\n";
    
    }
    But it's just not doing what i need it to do :S

    I'm just stuffing around with making a programme where you can enter a name & adress & what i want is when i change menu's the screen is cleared and everything is sitting at the top of the consol window, but i can't figure out how to do it

    if any of you brainiacs have a way of doing this can you please tell me
    Last edited by cruiser; 09-01-2011 at 08:34 PM.

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,434
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Registered User
    Join Date
    May 2011
    Location
    Around 8.3 light-minutes from the Sun
    Posts
    1,866
    Quote Originally Posted by Salem View Post
    Salem, really? You actually want people to look at the FAQs and tutorials before they post a questiom? How rude....
    Quote Originally Posted by anduril462 View Post
    Now, please, for the love of all things good and holy, think about what you're doing! Don't just run around willy-nilly, coding like a drunk two-year-old....
    Quote Originally Posted by quzah View Post
    ..... Just don't be surprised when I say you aren't using standard C anymore, and as such,are off in your own little universe that I will completely disregard.
    Warning: Some or all of my posted code may be non-standard and as such should not be used and in no case looked at.

  4. #4
    Registered User
    Join Date
    Aug 2011
    Posts
    9
    Quote Originally Posted by AndrewHunter View Post
    Salem, really? You actually want people to look at the FAQs and tutorials before they post a questiom? How rude....
    Thats what i was thinking, time to find a site with better people on it :P nah thanks, sorry if you did all the work for me just been a while with programming for me.

  5. #5
    Registered User
    Join Date
    May 2011
    Location
    Around 8.3 light-minutes from the Sun
    Posts
    1,866
    Quote Originally Posted by cruiser View Post
    Thats what i was thinking, time to find a site with better people on it :P nah thanks, sorry if you did all the work for me just been a while with programming for me.
    Really?
    Quote Originally Posted by anduril462 View Post
    Now, please, for the love of all things good and holy, think about what you're doing! Don't just run around willy-nilly, coding like a drunk two-year-old....
    Quote Originally Posted by quzah View Post
    ..... Just don't be surprised when I say you aren't using standard C anymore, and as such,are off in your own little universe that I will completely disregard.
    Warning: Some or all of my posted code may be non-standard and as such should not be used and in no case looked at.

  6. #6
    Registered User rogster001's Avatar
    Join Date
    Aug 2006
    Location
    Liverpool UK
    Posts
    1,409
    Hey Guys, i did search this topic before posting this but all i could find was stuff about system("cls") or some variation on that, i did try it but it seems my compiler (code::blocks) doesn't allow it.
    Did you have <stdlib> or <cstdlib> included as a header? Bearing in mind that clearing the (console) screen is very system specific, but of course you have read the FAQ now, so know that already ;->
    Thought for the day:
    "Are you sure your sanity chip is fully screwed in sir?" (Kryten)
    FLTK: "The most fun you can have with your clothes on."

    Stroustrup:
    "If I had thought of it and had some marketing sense every computer and just about any gadget would have had a little 'C++ Inside' sticker on it'"

  7. #7
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,434
    > Salem, really? You actually want people to look at the FAQs and tutorials before they post a questiom?
    Writing FAQ articles
    So what is the point of your "enthusiasm" here?

    If it makes you feel any better, I'll make a point of NOT referring people to any FAQ articles you write - how's that sound?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  8. #8
    Registered User
    Join Date
    May 2011
    Location
    Around 8.3 light-minutes from the Sun
    Posts
    1,866
    Quote Originally Posted by Salem View Post
    > Salem, really? You actually want people to look at the FAQs and tutorials before they post a questiom?
    Writing FAQ articles
    So what is the point of your "enthusiasm" here?

    If it makes you feel any better, I'll make a point of NOT referring people to any FAQ articles you write - how's that sound?
    It was a joke Salem, I meant that the answer was already there. I thought you brits appreciated "dry humor"
    Quote Originally Posted by anduril462 View Post
    Now, please, for the love of all things good and holy, think about what you're doing! Don't just run around willy-nilly, coding like a drunk two-year-old....
    Quote Originally Posted by quzah View Post
    ..... Just don't be surprised when I say you aren't using standard C anymore, and as such,are off in your own little universe that I will completely disregard.
    Warning: Some or all of my posted code may be non-standard and as such should not be used and in no case looked at.

  9. #9
    Registered User
    Join Date
    Aug 2011
    Posts
    9
    Quote Originally Posted by AndrewHunter View Post
    Really?
    Really what mate ?

  10. #10
    Registered User
    Join Date
    May 2011
    Location
    Around 8.3 light-minutes from the Sun
    Posts
    1,866
    Quote Originally Posted by cruiser View Post
    Really what mate ?
    The what is Salem gave you your answer; the FAQ article he linked answered your question.
    Quote Originally Posted by anduril462 View Post
    Now, please, for the love of all things good and holy, think about what you're doing! Don't just run around willy-nilly, coding like a drunk two-year-old....
    Quote Originally Posted by quzah View Post
    ..... Just don't be surprised when I say you aren't using standard C anymore, and as such,are off in your own little universe that I will completely disregard.
    Warning: Some or all of my posted code may be non-standard and as such should not be used and in no case looked at.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. clearing the screen
    By ssharish in forum C Programming
    Replies: 2
    Last Post: 02-01-2005, 08:00 PM
  2. Clearing the screen.
    By Roint in forum C Programming
    Replies: 3
    Last Post: 12-12-2003, 03:50 PM
  3. Clearing the screen
    By samuraijack in forum C Programming
    Replies: 11
    Last Post: 01-24-2003, 03:30 AM
  4. clearing the screen
    By kas2002 in forum Game Programming
    Replies: 3
    Last Post: 07-02-2002, 07:21 PM
  5. Clearing the screen
    By Shadow in forum C Programming
    Replies: 4
    Last Post: 05-23-2002, 01:40 PM

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