Search code examples
cbackcolor

Changing the back-color of the cmd window in C?


Is there a way to change the black background of the cmd window that open when

running the function to another color?


Solution

  • Right click on top bar of cmd then click properties then go to Colors tab and select your color then ok.

    #Edited

    use system(color 17);

    it will give you white font on blue background. here 1 for blue and 7 for white. remember first code for background color and second code for font color.

    here is some color codes.

    A = Light Green     
    B = Light Aqua 
    C = Light Red 
    D = Light Purple 
    E = Light Yellow
    F = Bright White
    0 = Black 
    1 = Blue   
    2 = Green 
    3 = Aqua
    4 = Red
    5 = Purple
    6 = Yellow
    7 = White 
    8 = Gray    
    9 = Light Blue