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";

Re: How to make colored output 80 80

Simple, use the SetConsoleTextAttribute() method from the Windows API

Re: How to make colored output 80 80

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..

Re: How to make colored output 80 80

You can still use it with printf.

Re: How to make colored output 80 80

Im realy confused now...could you write an example?

Re: How to make colored output 80 80

Im realy confused now...could you write an example?

Search the snippets section. You'll find code for that.

Re: How to make colored output 80 80

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.

Re: How to make colored output 80 80

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'

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.