Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

clrscr()not working in VC++(VS 2008).....?

Tags:

visual-c++

In VS 2008, I created an empty project in VC++ and added a source file as . . .

`

 #include<stdio.h>    

 #include<conio.h>

int main()
{
  ....
  clrscr();
  .....
  return 0;
}

`

I get these errors/warnings :

Warning 1 warning C4013: 'clrscr' undefined; assuming extern returning int c:\tc\toh.c 170 TOH

Error 3 error LNK2019: unresolved external symbol _clrscr referenced in function _main TOH.obj TOH

What the problem??

Thanks in advance..

like image 899
rsjethani Avatar asked Dec 12 '25 18:12

rsjethani


2 Answers

Are you trying to mix Borland libraries with VC++? That could be the problem. Can you clear the console instead by sending a bunch of \ns?

like image 131
Dave Avatar answered Dec 15 '25 17:12

Dave


Use the FillConsoleOutputCharacter and FillConsoleOutputAttribute functions. There is even an example of how to do that at MSDN, convenniently called "Clearing the screen"

like image 34
Jim Brissom Avatar answered Dec 15 '25 17:12

Jim Brissom



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!