Home >Backend Development >C++ >How Can I Print Colored Text in My Linux Terminal?
In a world where terminals have become indispensable for our daily work, adding a touch of colour to the output can enhance readability and organization. Terminals that support ANSI colour codes allow you to display text in a variety of hues.
To output coloured text to a Linux terminal that supports it, you must use ANSI colour codes. Be aware that not all terminals are compatible with these sequences. If they are not supported, you may encounter unintelligible characters.
Example:
cout << "3[1;31mbold red text3[0m\n";
Here, "
The above is the detailed content of How Can I Print Colored Text in My Linux Terminal?. For more information, please follow other related articles on the PHP Chinese website!