How to print coloured window with text?

How to print coloured window in output with text in it?

Hi, there's probably no universal way to do it... could you tell us the IDE you are using?
I am using Turbo c++.
turbo is little bit outdated, but if you are stuck with it (school recommendations or some stuff like that) try to google it... When I was stuck with turbo I also wanted to use color for my program, but in the end I used code-blocks

PS: let me know when you find some... I think you will need to install external library
I don't recommend Turbo C++ at all.
However, you can use the version of conio.h which comes with that IDE, but do bear in mind that this is not standard, anything you learn here will have to be un-learned later when you use a standard C++ compiler.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <conio.h>

int main()
{
    clrscr();
    textcolor(RED);
    cputs("red\r\n");
    textbackground(BLUE);
    textcolor(WHITE);
    cputs("blue+white");
    textbackground(GREEN);
    cputs("on green");

    getch();
    return 0;
}

I am also using c4droid android app. As android runs on linux kernel is there any way to do it on linux?
Topic archived. No new replies allowed.