Please, someone explain me why when I compile this code in Dev-C++ (Windows OS) the following error message apears: 'clrscr' undeclared (first use this function)

int main()
{ int c;
char d;
clrscr();
printf(" Example program for PSC232 \n");
setup();

printf("*IDN?\n\r");
send("*IDN?\n");
printf("RECEIVE...\n\r");
loop:
receive();

goto loop;
}

ps: ignore the functions setup, send and receive

I've just found a way to solve the problem. Include the stdlib library (#include <stdlib.h>;) and instead of clrscr(); code replace for system("cls"); and voilá it works.

On windows, you can do

system("cls")

to clear the screen

*Didnt see that you had posted and answered your own question lol

Thankx tokenjoker187

You're Welcome...

Also, with my experience with DevC++, getting 3rd party libraries are a pain. This is just a suggestion, but if you are unhappy with DevC++, try CodeBlocks IDE. It has plugins available for things like source code formatting and a class wizard. The other great thing is autocomplete. If you start programming in GTK or have 3rd party libraries you can hit CTRL+Space to get function names.

I'll take a look on CodeBlocks IDE.

I'm using DevC++ only for this project, normally I use NetBeans IDE. Take a look...

Thankx again...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.