0

Since no one cared to answer my thread posted earlier, :mad: I'm posting the question again.
I have this project to do and I want to use coloured text and some simple shapes, etc. But the problem is that my compiler does not support graphics.h or dos.h. Even my tclite doesn't (I mostly use BC5 windows version). Is there any way of correcting this problem? Or maybe another version which does support?
Will someone PLEASE help?

2
Contributors
1
Reply
2
Views
13 Years
Discussion Span
Last Post by fishman
0

Try this code, coloured text and backgrounds in dos

#include<iostream>
#include<conio.c>
using namespace std;
int main()
{
char intro[] = "Color Demo for Dev-C++ 4.9";
for(int b=0; b<=26; b++)
{
textcolor(b+1);
cout << intro;
}
cout << endl;
cout << endl;
textcolor(WHITE);
textbackground(BLACK);
system("pause");

cout << endl;
cout << "TEXT COLOURS" << endl;
cout << endl;
for(int a=0; a<=500; a++)
{
textcolor(a);
cout << a;
textcolor(WHITE);
textbackground(BLACK);
cout << " ";
if( (a+1) %16 == 0)
cout << endl;
}
cout << endl;
system("pause");
cout << endl;;

textcolor(WHITE);
textbackground(BLACK);
cout << "BACKGROUND COLOURS" << endl;
cout << endl;
for(int a=1; a<=16; a++)
{
textbackground(a);
cout << a;
textbackground(BLACK);
cout << " ";
}

cout << endl;
cout << endl;
system("pause");
return 0;
}

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.