Sum xcode help please w/ SYSTEM("CLEAR")C++

Discussion in 'Mac Programming' started by unknown.exe, Oct 17, 2007.

  1. unknown.exe macrumors member


    Sep 22, 2007
    Somewhere on Earth
    sup im usin xcode and im tryin to make the prog clear the screen and NOT TO wait for the user to press sumptin to continue. Like i want the screen to clear and continue w/ the prog without the user havin 2 press enter..... ive already tried SYSTEM("CLEAR") AND i included the proper header file.... it doesnt work:mad::confused::eek::mad::confused::eek:!!!!!!!!!!!! Like when i build and compile, it lets me run the prog without any errors.... BUT WAIT!!!!:eek: When i get to the part that is supposed to clear the screen... it says my prog ended w/ a value of zero, and next to that sum weird thing in parenthesis (if i remember correctly). Sumone plerse help me! This program is written in C++.
  2. kainjow Moderator emeritus


    Jun 15, 2000
  3. John Jacob macrumors 6502a

    John Jacob

    Feb 11, 2003
    Columbia, MD
    Haha... Actually, we are magicians, but we need the code to work our magic on. :D

    Speaking only for myself, whenever some complex code that I write finally starts working as intended, I feel like a magician.
  4. janey macrumors 603


    Dec 20, 2002
    sunny los angeles
  5. garethlewis2 macrumors 6502

    Dec 6, 2006
    This is another classic case of "I want to pump this bicycle tire up with a potato, it doesn't work, whats wrong?"

    Trying to call the unix command to clear the terminal is not going to work easily. clear needs to know the terminal setting to correctly send the page feed command. In your program, it won't be running in a terminal so would probably just fail and set an error in ERRNO. What you need todo is use Curses or NCurses. They were designed especially for this purpose, they turn your line or terminal window in to a completely editable interface.

    There are plenty of example programs that use NCurses, and most tutorials will show you how to clear the screen.
  6. gnasher729 macrumors P6


    Nov 25, 2005
    To clarify your thoughts, could you describe in plain, correct English without any spelling mistakes what you mean by "clear the screen"? On my system, not even "the screen" makes sense. Do you mean the left one or the right one or both?
  7. lazydog macrumors 6502a

    Sep 3, 2005
    Cramlington, UK
    You need a fur … nuxt loop with an iv… thun … ehls condition. Don't forget to mark your classes privet, pubic or gang_member as appropriate. Oh and don't forget to eggsit cleanly! :D:rolleyes:

    b e n

Share This Page