why do i get this error?

Jan 11, 2012 at 4:52pm
http://s1236.photobucket.com/albums/ff451/threatn/?action=view&current=Capture3213.png
why do i the curly red underline for clrscr()??? btw i am using visual studio
Jan 11, 2012 at 4:56pm
What error message do you get?
Jan 11, 2012 at 4:58pm
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 4:58pm
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
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:29pm
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 12, 2012 at 2:52am
for
http://s1236.photobucket.com/albums/ff451/threatn/?action=view&current=321.png
i still get error C3861: 'clrscr': identifier not found
and for
http://s1236.photobucket.com/albums/ff451/threatn/?action=view&current=321.png#!oZZ3QQcurrentZZhttp%3A%2F%2Fs1236.photobucket.com%2Falbums%2Fff451%2Fthreatn%2F%3Faction%3Dview%26current%3DCapture3213.png
i get
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
error C3861: 'clrscr': identifier not found
Jan 12, 2012 at 3:18am
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 3:50am
http://en.wikipedia.org/wiki/Conio.h "The library functions declared by conio.h vary somewhat from compiler to compiler" clrscr() is not listed there.

¿Why you don't copy-paste your code?
Jan 12, 2012 at 12:51pm
@imbaegod

how about using namespace std ???
Jan 12, 2012 at 3:41pm
@codekiddy
He's using pure C. C doesn't have namespaces.

-Albatross
Jan 12, 2012 at 5:49pm
Albatros,
He's using pure C. C doesn't have namespaces


I'm not shore about that since he is receiving errors related to C++ not C:
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int


but maybe am I missing something here :/
Jan 12, 2012 at 6:32pm
closed account (1vRz3TCk)
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.
Topic archived. No new replies allowed.