+ 2

How to add color in C programming language?

Hello friend I don't how to add color in C?It is possible to add text color and background color?If it is possible can you give me some tips or syntax for it?

10th Jul 2018, 1:43 AM
Anish Poudel
Anish Poudel - avatar
4 odpowiedzi
+ 10
Colours are not part of the standard of the language. It would depend on your operating system, console and/or GUI library. Strictly speaking, it is not possible on Code Playground.
10th Jul 2018, 1:45 AM
Hatsy Rei
Hatsy Rei - avatar
+ 6
You can try using SDL2 on your PC. You may want to use C++. https://www.sololearn.com/discuss/498964/?ref=app
10th Jul 2018, 1:49 AM
Manual
Manual - avatar
+ 5
It would be best to look into existing GUI libraries if you want to do colours. Console applications would focus solely on getting the job done. However, if you insist, you may check this link out. It would work on desktop. https://stackoverflow.com/questions/9203362/c-color-text-in-terminal-applications-in-windows
10th Jul 2018, 1:50 AM
Hatsy Rei
Hatsy Rei - avatar
+ 1
Hello hasty ! You tell that it is not possible in code playground but it is possible in other app or software.
10th Jul 2018, 1:48 AM
Anish Poudel
Anish Poudel - avatar