Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

unknown.exe

macrumors member
Original poster
Sep 22, 2007
67
0
Somewhere on Earth
C++:
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++.
 

garethlewis2

macrumors 6502
Dec 6, 2006
277
1
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.
 

gnasher729

Suspended
Nov 25, 2005
17,980
5,566
C++:
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++.

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?
 

lazydog

macrumors 6502a
Sep 3, 2005
709
6
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
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.