3

C++ Program to print colored text

 2 years ago
source link: https://www.geeksforgeeks.org/videos/c-program-to-print-colored-text-2/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

C++ Program to print colored text

C++ Program to print colored text
  • 350 Views
  • 22/08/2022

In this video, we'll show you how to print coloured text using the C++ library.

In computer programming, printing text is a common task. The standard way to do this is to use the system function printf(). This function takes several arguments, such as the name of the file where the output should go, the number of characters printed, and the colour of each character.

In C++ programming, by default the background of the output screen is black and the text colour is in white colour. We can colour both the background and text colour in the output screen in the following ways.

We need to add the following Header Files for changing the colour of a text.

#include <windows.h>  
#include <stdlib.h>

Syntax: system("Color XY")

Here, we have used the above-mentioned command to change the background colour and text.

How to print Colored text in C++
https://www.geeksforgeeks.org/how-to-print-colored-text-in-c/


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK