★ 글자색을 변경해 봅시다

c언어 글자색 바꾸기

 

#include  <cstdio>
#include  <windows.h>
void textcolor(int color_number) 
{ 
    SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), color_number); 
} 
int main() 
{ 
    int i; 
    for(i=1;i<=15;i++) 
    { 
        textcolor(i); 
        printf("안녕하세요\n"); 
    } 
    return 0; 
}
Posted by 명문코딩컴퓨터
,