說到輸出首先就想到了printf函數,例如:數組
char *p="123456789";
printf("123456789");
printf("%s","123456789");
printf(p);
那有沒有其餘方法呢,我查閱了一些資料。ide
好比用fputs函數函數
fputs(p,stdout);
這樣也能夠在屏幕上打印出123456789spa
用puts函數指針
puts(p);
能夠打印出123456789而且自動換行。orm
函數資料:字符串
對於ANSI C 程序,運行時系統會打開至少三個流,這3個流包括:input
1. 標準輸入 standard input . 標準定義爲stdin.it
2 標準輸出 standard output. 標準定義爲stdoutclass
3. 標準錯誤 standard error. 標準定義爲stderr.
fputs(...)用於向這三個流寫入數據。
因此fputs(p,stdout)能夠輸出字符串,p能夠爲數組名,字符指針或字符串常量。
puts()函數用來向標準輸出設備(屏幕)寫字符串並換行,其調用方式爲,puts(p);其中p能夠爲數組名,字符指針或字符串常量。