Output Problem - Windows. library

Hey Guys,I have been playing around with <windows.h> today and encountered the system("color 01") function,I decided to give it a go on a program i had made recently and encountered a strange problem,First here's the code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include<iostream>
#include<windows.h>
using namespace std;
int main()
{
    system("color 07");
    cout.width(108);
    cout << "Hospital Care Software\n";
    cout.width(110);
    cout << "--------------------------\n";


    system("color 06");
    cout.width(100);
    cout << "MENU:\n";
    cout << "\n1.Add A Patient\n2.OPD Appointment\n3.Show Charges\n4.View Patient Details\n5.Modify Patient Details\n6.Emergency\n7.Customer Care\n8.Instruction Manual\n9.EXIT";
    return 0;
}


As you can see i intend to have the color of the first line different than the rest but it stays system("color 07"); for a millisecond and then all the output changes to yellow the second color,how can i resolve that? Sorry if i am being stupid.
Last edited on
I told what the 'color' is in your other thread: http://www.cplusplus.com/forum/beginner/241795/

"PDCurses" might solve your issue:
https://www.quora.com/How-do-I-print-multiple-colors-of-text-to-the-console-using-C
Topic archived. No new replies allowed.