Advertisement

C++ newbie problem

Started by June 29, 2002 09:41 AM
12 comments, last by runtime 22 years, 4 months ago
I believe you have to include dos.h. If it is not that then it is something else because I have used clrscr.
----------------------------------------------------"Plant a tree. Remove a Bush" -A bumper sticker I saw.
here is the code that would do what you want:

    #include <iostream>#include <stdlib.h>int main(int argc, char *argv[]){ system("CLS"); std::cout<<"Hello world!";  return 0;}    

forgot, this is very platform dependant, so, for example that is the windows version, for linux, as another example, you would replace "cls" with "clear"

[edited by - pointer0death on June 30, 2002 7:14:17 PM]
Advertisement
clrscr() is a Borland function and not part of the standard. Doing system("CLS") should work, but it isn''t the most efficient thing, if that matters. You can pick up something like pdcurses.
When in doubt go see google:

http://www.phanderson.com/C/clrscr.html

http://www.delorie.com/djgpp/doc/libc/libc_105.html

http://www.newbie.org/snippets/chats/bcb4/message/23.html

now take your own conclusions...

This topic is closed to new replies.

Advertisement