Jan 11, 2012 at 4:56pm Jan 11, 2012 at 4:56pm UTC
What error message do you get?
Jan 11, 2012 at 4:58pm Jan 11, 2012 at 4:58pm UTC
Odd. I'm not sure why it doesn't recognize clrscr() when it recognizes getch().
-Albatross
P.S. - Even though the C language (I believe) will let it slide, it's still a good idea to explicitly specify that main() returns an int
. C++, however, will not.
Last edited on Jan 11, 2012 at 5:00pm Jan 11, 2012 at 5:00pm UTC
Jan 11, 2012 at 4:58pm Jan 11, 2012 at 4:58pm UTC
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
error C3861: 'clrscr': identifier not found
Jan 11, 2012 at 7:25pm Jan 11, 2012 at 7:25pm UTC
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1 2 3 4
main()
{
return 0;
}
well do you see why that error cames out??
error C3861: 'clrscr': identifier not found
it is not found because first error isn't resolved.
resolve first error, then clrscr will work just fine.
Last edited on Jan 11, 2012 at 7:26pm Jan 11, 2012 at 7:26pm UTC
Jan 11, 2012 at 7:29pm Jan 11, 2012 at 7:29pm UTC
can you past your code . so that we can see it .
ok ..got it ..
try to use .
1 2 3 4
int main()
{
return 0;
}
Last edited on Jan 11, 2012 at 7:31pm Jan 11, 2012 at 7:31pm UTC
Jan 12, 2012 at 3:18am Jan 12, 2012 at 3:18am UTC
At the end of the day, how important is it that you clear the screen (an operation that goes against console programming philosophies) anyway?
-Albatross
Jan 12, 2012 at 12:51pm Jan 12, 2012 at 12:51pm UTC
@imbaegod
how about using namespace std
???
Jan 12, 2012 at 3:41pm Jan 12, 2012 at 3:41pm UTC
@codekiddy
He's using pure C. C doesn't have namespaces.
-Albatross
Jan 12, 2012 at 6:32pm Jan 12, 2012 at 6:32pm UTC
The code is C, compiled with a C++ compiler.
conio.h is a non-standard header, so there is no guarantee of what is declared in it.