Jump to content
xisto Community
Sign in to follow this  
ewcreators

Colors/styles For Text? How do we change colors?

Recommended Posts

How do i change colors or styles of text in c++?

like for colors eg. :

hello world

for styles:

Hello World


Such a thing is not really possible. Really, things like style and color are part of the output, and if you are using something like cout (in iostream) it is only sending a string to Standard Out.

 

Even with something such as printf (this is, of course, a Java function, but there is something similar in C++), the output text is simply formatted into a different string. Attributes such as color and style are a part of the OS or the environment that you are running in. If you are writing this code in Visual C or something, it may be possible. This topic is covered a little here:

 

https://bytes.com/topic/c/answers/131982-how-change-text-colour

 

If you would like a Visual C tutorial for this, I believe that this will work:

 

https://www.daniweb.com/programming/software-development/threads/9921/change-text-color-using-visual-c

 

Hope this helps!

Share this post


Link to post
Share on other sites

For normal C, use header file GRAPHICS.H for advanced graphics support for your programs in C.There are many built in functions to set the style of text and other output objets.Read the document of GRAPHICS.H for its every functions and its uses.

Share this post


Link to post
Share on other sites
how do i change size & color of textColors/styles For Text?

Please tell me how I can change the colour & size of text  and the colour of backround

in C Language.

-question by Yogesh Garg

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.