您的位置:首页 > 其它

控制台程序怎样改变颜色

2008-10-07 23:14 197 查看
方法一:

#include "stdlib.h"

system("color a");

方法二:

#include <windows.h>
#include "stdio.h"

void setcolor(unsigned short color)
{
HANDLE hCon = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTextAttribute(hCon,color);
}

int main()
{
setcolor(0x16);
printf("颜色字符串!");

return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: