How to change text color and console color in code::blocks?

后端 未结 8 1908
故里飘歌
故里飘歌 2020-12-08 17:29

I am writing a program in C. I want to change the text color and background color in the console. My sample program is -

#include 
#include &         


        
8条回答
  •  南方客
    南方客 (楼主)
    2020-12-08 18:12

    An Easy Approach...

    system("Color F0");
    

    Letter Represents Background Color while the number represents the text color.

    0 = Black

    1 = Blue

    2 = Green

    3 = Aqua

    4 = Red

    5 = Purple

    6 = Yellow

    7 = White

    8 = Gray

    9 = Light Blue

    A = Light Green

    B = Light Aqua

    C = Light Red

    D = Light Purple

    E = Light Yellow

    F = Bright White

提交回复
热议问题