C++往標準輸出寫入一個字符

代碼:

#include <stdio.h>
int main(){
        printf("hello,world!\n");
        putchar('a');
        putchar('\n');
        putchar('b');
        putchar('\n');
        return 0;
}

輸出:

[root@localhost test]# g++ -o demo main.cpp 
[root@localhost test]# ls
demo  main.cpp
[root@localhost test]# ./demo 
hello,world!
a
b
[root@localhost test]# 
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章