无法更改 Visual Studio 2010 中输出的文本颜色和文本背景

not able to change text color and text background of output in visual studio 2010

本文关键字:文本 输出 颜色 背景 2010 Visual Studio      更新时间:2023-10-16

如何在Visual Studio 2010中更改输出的文本颜色和文本背景? textcolor() ,textbackground(), textmode()功能不起作用。还有其他选择吗?

如果我正确理解了您的问题,并且您正在谈论在c/c ++控制台应用程序中更改颜色。
您可以使用 SetConsoleAttribute 在控制台中更改颜色。这是一个例子