compiling problem

iuse devc++ to complie and when i compile a program says

in function menu()
"clrscr()" undeclared (first use this funnction )

Last edited on
closed account (z05DSL3A)
Can you post your code, so we can see the problem?


How to: Put code into your postings
http://www.cplusplus.com/forum/articles/1624/
the code :D
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# include <iostream.h>
# include <stdio.h>
# include <stdlib.h>
# include <conio.h>
int n=6,m=49,ll=0,ul=49,i,j,pn[50],cn[50],aux[50],o1,o2,o3,o4,o5,o6,temp,ok;
void main_menu()
{
clrscr();
cout<<endl<<endl<<endl<<endl<<endl<<endl;
cout<<"			Alien Software International";
cout<<endl<<endl<<endl<<endl;
cout<<"			         Loto Game";
cout<<endl<<endl<<endl<<endl<<endl<<endl;
cout<<"	Main Menu";
.............




i have several functions like this and for each of them returns the same error when i compile :

in function menu()
"clrscr()" undeclared (first use this funnction )
Last edited on
closed account (z05DSL3A)
My think that your comiler dosn't have an implementation of clrscr().
You may have downloaded the standard MinGW compiler, which has nothing "Borlandish." You may try Googling "Dev-C++ Borland" or summat and you can probably find something to use. :)

1
2
3
4
else if(borlandCompilers == 0)
{
 system("cls");
}

tried with Dev ++ Borland compiler but the same error...i also downloaded the C++ Builder...but cant manage to compile with that one :(

pls help me
Last edited on
It's #include <iostream> not # include <iostream.h> .

also.


clrscr() is a presumptuous Borland fetish. Not every user of your program wants it!!!

In Dev C++ you can use system("CLS") to do the trick, the old DOS command. Include the stdlib.h for the system() function.
done with system("cls") but still this error on compile

32:2 C:\Dev-Cpp\include\c++\3.4.2\backward\backward_warning.h #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <iostream> instead of the deprecated header <iostream.h>. To disable this warning use -Wno-deprecated.


1
2
3
4
5
6
# include <iostream.h>
# include <stdio.h>
# include <stdlib.h>
# include <conio.h>
int n=6,m=49,ll=0,ul=49,i,j,pn[50],cn[50],aux[50],o1,o2,o3,o4,o5,o6,temp,ok;
void main_menu()


tryed to use only iostream instead of iostream.h but than it doesn recognize any functio of cout,cin and rest...:(
Last edited on
1. using namespace std will make that function nonrecognition go away. Just stick it under the header files.

b. use <iostream>, <cstdio>, <cstdlib>. System("cls") doesn't need <conio.h>, or any header for that matter.

Hope this helps. (Sorry duoas, I took your line.)
---
DOWN WITH DVORAK
thanks..but what you mean by using namespace std will make that function nonrecognition go away???
Last edited on
the iostream,fstream,conio etc headers are declared in the namespace std...
please explain me how to use that...i'm only a c++ beginer :( with not much experience :(
1
2
3
#include <iostream>

using namespace std;
Last edited on
Thanks Nandor, I've been away for a while.
thanks ;)
Topic archived. No new replies allowed.