Linux编写C程序发现


这几天我安装了一个Linux系统,想在里面学一下C语言的编写,发现在里面运行有一个好奇怪的现象:如下面

[cpp]

  1. #include<stdio.h>   
  2. void mian(){  
  3.     printf("hello world!");  
  4. }  

输出没有结果!搞的我看了半天,程序没有错误啊!怎么这样!后来我把程序改为

[cpp]

  1. #include<stdio.h>   
  2. void mian(){  
  3.     printf("hello world!/n");  
  4. }  

编译,运行,输出hello world!

我晕!原来是没有就加换行符!!谁知道为什么会这样啊??

相关内容