换行符 \n 本身是 转义 字符 或 常数。
所以不能 #define 它是什么
当然,你可以定义 别的 符号 等于它。
例如:
#define xx '\n'
#define s "\n"
void main()
{
int a=3;
a = a + xx;
printf("%d%s....",a,s);
}
结果:
13
....
看你要什么时候用啊。。。
如果在printf中用,可以这样:
#define NEWLINE "\n"
printf("Hello, world!" NEWLINE);
不过看起来怪怪的就是了..
你找到\n的ASCII值的话 在给char赋值的时候可以用
但是像printf这样的函数应该没戏
恩,是的,以上的两种都可以实现的!