📜  cmd color text c++代码示例

📅  最后修改于: 2022-03-11 14:44:45.736000             🧑  作者: Mango

代码示例1
#include 
#include  
int main()
{
    HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
    for(int k = 1; k < 255; k++) //higher k = more colour
    {
        SetConsoleTextAttribute(hConsole, k);
        std::cout << k << std::endl;
    }
}