Problem with clrscr()

A

AHR

Hi NG

I am learning MFC but only use the command promt at the moment to run my C++
programs.

My problem is that i cant use clrscr() even if i include <conio.h>.

I get this error:

****
error C2065: 'clrscr' : undeclared identifier
****

Can anyone help?

Thanks
AHR
 
J

John Carson

AHR said:
Hi NG

I am learning MFC but only use the command promt at the moment to run
my C++ programs.

My problem is that i cant use clrscr() even if i include <conio.h>.

I get this error:

****
error C2065: 'clrscr' : undeclared identifier
****

Can anyone help?

Thanks
AHR


Your question is off-topic in this newsgroup since it is system specific.
The newsgroup

microsoft.public.vc.language

is the best place to ask (or you could try microsoft.public.vc.mfc).

The reason why you are getting the "undeclared identifier" message is
because clrscr is neither part of the C++ standard nor a Microsoft extension
to the C++ standard. Thus the function does not exist on your compiler. You
might try

system("cls");
 
Joined
Aug 7, 2008
Messages
2
Reaction score
0
Really Works Dude!... Thanks For All...

eLow!... dude., it really works with what is suggested by Mr. John Carson....
it works with my Microsoft Visual C++ 6.0 Standard Edition and im sure it'LL work also with other edition like Enterprise Edition and the like...
here is a example:...

#include < conio.h>
#include <stdlib.h> /*stdlib.h is somewhat compulsory by the way and
not necessary but i would suggest to include it...*/
...
main()
{
...
system("cls");

note that as this is a command, it must appear after your variable
declarations like "main()".

:veryprou:
 
Last edited:
Joined
Aug 7, 2008
Messages
2
Reaction score
0
In Addition....

for those c programming language like that of Turbo Pascal.,
here is a example:...


Program example;
uses Crt;
...
begin
writeln('Press any key to clear the screen');
readln; /* or it can be "readkey;" */
clrScr;
writeln('Have fun with the cleared screen');
end.
:veryprou:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top