小谈printf

来源:互联网 发布:php enchant扩展 编辑:程序博客网 时间:2024/06/08 08:30

知识点1:

printf 函数使用的是缓冲 I/O 方式格式化输出,当其遇到/n时才输出。

例: printf("This is test the printf function");     // 没有/n

       printf("test/n");     // 有/n

       exit(0);      //退出时清理I/O缓冲

输出:#This is test the printf function

          #test

       printf("This is test the printf function");      // 没有/n

       printf("test/n");     //有/n

       _exit(0);     //强行退出,不管I/O情况

输出:#test

原创粉丝点击