A few beginner C++ questions
I am learning C++ in school with the Turbo C++ compiler. At home, though, I have Visual C++ 6.0. Anyway, I can''t use the very necessary functions clrscr() or getch() on VC++. I was wondering if anyone knows what the equivilent would by on VC++. I''m not sure this is the best forum for this question, but because it''s a beginners one and I''m a beginner, I hope I made the right choice. Thanks in advance.
(note: I''m not a Windows programmer, yet, so any responses must deal with, ugh, DOS)
I''ll think of a signature later...
______________________________I'm a Greek advocating the resurrection of the Byzantine Empire. Join me.
getch() is in conio.h, are you including it?
as for clrscr() theres system("cls") or you just simply print a load of newlines to the screen thus clearing it
as for clrscr() theres system("cls") or you just simply print a load of newlines to the screen thus clearing it
Doh! You''re right! getch() does work! Sorry for my stupidity. Anyway, cls doesn''t. Any ideas why? Special syntax or anything? Do I just type cls?
I''ll think of a signature later...
I''ll think of a signature later...
______________________________I'm a Greek advocating the resurrection of the Byzantine Empire. Join me.
Oh, wait--I see. I type:
system("cls");
... and that clears the screen. I''ll give it a shot. Thanks.
Hey, wait, no, it doesn''t work. What''s going on here? Do I need to include a special file or something? Please respond or I''ll die.
I''ll think of a signature later...
system("cls");
... and that clears the screen. I''ll give it a shot. Thanks.
Hey, wait, no, it doesn''t work. What''s going on here? Do I need to include a special file or something? Please respond or I''ll die.
I''ll think of a signature later...
______________________________I'm a Greek advocating the resurrection of the Byzantine Empire. Join me.
Someone posted an implementation of clrscr for VC++ somewhere in these forums earlier and you can also find it in forum FAQ on cprogramming.com.
---visit #directxdev on afternet <- not just for directx, despite the name
you need to add at the top of your program, #include <windows.h> that should do the trick!
You can just write your own clrscr():
that just prints out 25 new lines, effectivly clearing away the screen
void ClearScreen(){for(int i =0; i < 25; i++)cout<<"\n"; //or cout<<endl;}
that just prints out 25 new lines, effectivly clearing away the screen
President: Video Game Development Club of UCIhttp://spirit.dos.uci.edu/vgdc
April 05, 2002 02:55 PM
You can just write your own clrscr():
that just prints out 25 new lines, effectivly clearing away the screen
void ClearScreen(){for(int i =0; i < 25; i++)cout<<"\n"; //or cout<<endl;}
that just prints out 25 new lines, effectivly clearing away the screen
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement