regent
asked on
Change background color and text color
I am trying to create a simple splash screen program. Our instructor showed that we'd use the "textbackground" and
"textcolor" functions. I am using Borland C++ 4.52.
Supposedly all I have to put in my program is:
textbackground(BLUE);
textcolor(YELLOW);
but I come up with errors - "undefined function".
Anybody have any thoughts on how to fix this?
Thanks.
"textcolor" functions. I am using Borland C++ 4.52.
Supposedly all I have to put in my program is:
textbackground(BLUE);
textcolor(YELLOW);
but I come up with errors - "undefined function".
Anybody have any thoughts on how to fix this?
Thanks.
ASKER
I did. Here's my code:
#include <iostream.h>
#include <conio.h>
void main()
{
textbackground(BLUE);
textcolor(YELLOW);
clrscr();
cout << endl << endl << endl << endl;
cout << " ************************** ********** ********** ********** ****";
cout << endl << endl << endl;
cout << " THOMAS REGEN" << endl;
cout << " CPT 123";
cout << endl << endl;
cout << " PROGRAM NAME: SPLASH SCREEN";
cout << endl << endl << endl;
cout << " ************************** ********** ********** ********** ****";
cout << endl << endl << endl;
cout << " PRESS ANY KEY TO CONTINUE...";
getch();
}
#include <iostream.h>
#include <conio.h>
void main()
{
textbackground(BLUE);
textcolor(YELLOW);
clrscr();
cout << endl << endl << endl << endl;
cout << " **************************
cout << endl << endl << endl;
cout << " THOMAS REGEN" << endl;
cout << " CPT 123";
cout << endl << endl;
cout << " PROGRAM NAME: SPLASH SCREEN";
cout << endl << endl << endl;
cout << " **************************
cout << endl << endl << endl;
cout << " PRESS ANY KEY TO CONTINUE...";
getch();
}
Be sure to include <conio.h>
It is the header file that contains the prototype for the background and foreground text colors
It is the header file that contains the prototype for the background and foreground text colors
ASKER
I did include <conio.h>. See code above.
Try
#include <conio.h>
#include <iostream.h>
#include <conio.h>
#include <iostream.h>
ASKER
I didn't see a new comment.
<conio.h> was included. See code above.
<conio.h> was included. See code above.
ASKER
Nope, that didn't work either.
ASKER
Can anyone compile and run my code to see if you can get it to work?
What about #include <dos.h>?
ASKER
No, that didn't work either. This is really frustrating because you know it's gotta be something simple.
Open conio.h and search for textbackground. Is there any #if before it?
ASKER
Not that I can tell.
It is DOS ?
ASKER
Not that I can tell.
ASKER
<dos.h> didn't work either. Has anyone been able to compile and run my code? I'm about to give up.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks Alex! You were right, 4.52 (for some reason), doesn't recognize those funictions (even though the Help discusses them). Once I got to school and compiled it on 5.02, it worked like a champ. Thanks again. Thomas
or
#include <dos.h>