5
在C++中的下列代码在控制台中运行将打印彩色文本:如何创建彩色文本?
cout << "\e[32;40mGreenForegroundAndBlackBackgroundText" << endl;
在d我得到一个错误:
string s = "\e[32;40mGreenForegroundAndBlackBackgroundText"; // undefined escape sequence \e
有没有什么办法让d这方面的工作?
请记住,上面的转义序列在任何其他非ANSI终端中都不起作用。 – DejanLekic 2012-02-06 09:21:55
我一直在为[此图书馆](http://code.google.com/p/decora)工作! (我不敢相信这是多么的偶然。) – Maxpm 2012-02-09 03:00:45