ok here I want to know how to make colorated output in C and C++...
For example: I want to print this string "zelena". The color must be green. Now how to get green output using printf() in C and cout << "zelena";
ok here I want to know how to make colorated output in C and C++...
For example: I want to print this string "zelena". The color must be green. Now how to get green output using printf() in C and cout << "zelena";
Simple, use the SetConsoleTextAttribute() method from the Windows API
Simple, use the SetConsoleTextAttribute() method from the Windows API
Yeah, but i want to get colored output using printf() function...
Also I`m still complete n00b..
You can still use it with printf.
Im realy confused now...could you write an example?
Im realy confused now...could you write an example?
Search the snippets section. You'll find code for that.
http://www.daniweb.com/code/snippet83.html
http://www.daniweb.com/code/snippet72.html
every chatacter occupies 2 Bytes in VDU memeory.
First is for its ascii value, while next for its color.
To change the color of the text, u need to change this Byte.
every chatacter occupies 2 Bytes in VDU memeory.
First is for its ascii value, while next for its color.
To change the color of the text, u need to change this Byte.
U must be able to right the required code for this now.
and one more thing, forget 'printf'
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.