Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Problem with clrscr()

Reply
Thread Tools

Problem with clrscr()

 
 
AHR
Guest
Posts: n/a
 
      01-26-2004
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


 
Reply With Quote
 
 
 
 
John Carson
Guest
Posts: n/a
 
      01-26-2004
"AHR" <(E-Mail Removed)> wrote in message
news:401507df$0$95018$(E-Mail Removed) k
> 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");


--
John Carson
1. To reply to email address, remove donald
2. Don't reply to email address (post here instead)

 
Reply With Quote
 
 
 
 
ensvhiiotus_17 ensvhiiotus_17 is offline
Junior Member
Join Date: Aug 2008
Posts: 2
 
      08-07-2008
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()".

 

Last edited by ensvhiiotus_17; 08-07-2008 at 10:05 AM..
Reply With Quote
 
ensvhiiotus_17 ensvhiiotus_17 is offline
Junior Member
Join Date: Aug 2008
Posts: 2
 
      08-07-2008
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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem problem problem :( Need Help Mike ASP General 2 05-11-2004 08:36 AM



Advertisments