函数参数属性

代码案例
#include <iostream>
#include <stdio.h>
int main()
{
printf("\033[1;31;40m hello world\n\033[0m");
printf("\033[4;32;40m hello world\n\033[0m");
printf("\033[5;33;40m hello world\n\033[0m");
printf("\033[7;34;40m hello world\n\033[0m");
printf("\033[8;35;40m hello world\n\033[0m");
printf("hello world\n");
return 0;
}
执行结果

格式说明
开头:\033[属性A;属性B;属性Cm
结尾,用于结束色彩打印:\033[0m
本文详细解读了C++中如何使用ANSI转义序列控制输出的文本颜色,通过实例展示了不同参数组合下控制文本样式的效果,适合初学者理解控制台输出的高级技巧。
3万+

被折叠的 条评论
为什么被折叠?



