compiling problem

Jul 1, 2008 at 10:59am
iuse devc++ to complie and when i compile a program says

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

Last edited on Jul 1, 2008 at 10:59am
Jul 1, 2008 at 11:39am
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/
Jul 1, 2008 at 3:02pm
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 Jul 1, 2008 at 3:03pm
Jul 1, 2008 at 4:19pm
closed account (z05DSL3A)
My think that your comiler dosn't have an implementation of clrscr().
Jul 2, 2008 at 12:37am
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");
}

Jul 2, 2008 at 4:53am
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 Jul 2, 2008 at 7:18am
Jul 2, 2008 at 7:02pm
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.
Jul 4, 2008 at 7:34am
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 Jul 4, 2008 at 7:36am
Jul 4, 2008 at 11:42am
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
Jul 4, 2008 at 11:55am
thanks..but what you mean by using namespace std will make that function nonrecognition go away???
Last edited on Jul 4, 2008 at 12:05pm
Jul 4, 2008 at 12:40pm
the iostream,fstream,conio etc headers are declared in the namespace std...
Jul 5, 2008 at 7:43am
please explain me how to use that...i'm only a c++ beginer :( with not much experience :(
Jul 6, 2008 at 3:25pm
1
2
3
#include <iostream>

using namespace std;
Last edited on Jul 6, 2008 at 3:25pm
Jul 7, 2008 at 12:45am
Thanks Nandor, I've been away for a while.
Jul 7, 2008 at 3:12pm
thanks ;)
Topic archived. No new replies allowed.