| | |
Substitute for system("cls")`
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
The question is in the title. Rather then making a call to the OS, is there a more efficient way to do this? Thanks
Edit: Just though of something else to.
Does Sleep(2000); make a call to the OS as well? If so is there another way to do this as well?
Edit: Just though of something else to.
Does Sleep(2000); make a call to the OS as well? If so is there another way to do this as well?
Last edited by clutchkiller; Dec 12th, 2008 at 4:13 pm.
>That confuses me =(
Get used to it. Good programmers are in a constant state of confusion.
>Looks like i have some quasi specifics to investigate! Up Up And AWAY!
Get used to it. Good programmers are in a constant state of confusion.
>Looks like i have some quasi specifics to investigate! Up Up And AWAY!
Both sleep and cls are non-portable.
There is no portable method to clear the screen
Thats because you cant guarauntee the output device is nececerially the screen. e.g on an embedded device it could be a typewriter or something
There is no portable method to clear the screen
Thats because you cant guarauntee the output device is nececerially the screen. e.g on an embedded device it could be a typewriter or something
Last edited by jbennet; Dec 12th, 2008 at 4:15 pm.
If i am helpful, please give me reputation points.
>is there a more efficient way to do this?
You mean without moving away from the console for non-sequential output? You could try pdcurses or something similar. At least that way you have more control, but if you're doing any kind of GUI-like interface or advanced drawing, you'd be better off taking the plunge into a modern graphics API.
>Does Sleep(2000); make a call to the OS as well?
How exactly are you expecting to talk to the system or any peripherals without making a call to the OS?
You mean without moving away from the console for non-sequential output? You could try pdcurses or something similar. At least that way you have more control, but if you're doing any kind of GUI-like interface or advanced drawing, you'd be better off taking the plunge into a modern graphics API.
>Does Sleep(2000); make a call to the OS as well?
How exactly are you expecting to talk to the system or any peripherals without making a call to the OS?
I'm here to prove you wrong.
•
•
Join Date: Sep 2008
Posts: 90
Reputation:
Solved Threads: 12
Look at this link:
http://faq.cprogramming.com/cgi-bin/...&id=1043284385
The last method is probably what you're looking for.
http://faq.cprogramming.com/cgi-bin/...&id=1043284385
The last method is probably what you're looking for.
![]() |
Other Threads in the C++ Forum
- Previous Thread: Just started
- Next Thread: What should be my arguments for function called in main()
| Thread Tools | Search this Thread |
api application array arrays based beginner binary bmp c++ c/c++ calculator char char* class classes code compile compiler console conversion count data delete deploy dll download dynamic dynamiccharacterarray email encryption error file format forms fstream function functions game givemetehcodez google graph gui homeworkhelp iamthwee ifstream input int java lib library linkedlist linker list loop looping loops map math matrix memory microsoft newbie news number numbertoword output pointer problem program programming project python random read recursion recursive reference rpg simple sorting string strings temperature template test text text-file tree unix url variable vector video visual visualstudio win32 windows winsock wordfrequency wxwidgets






