廣州市荔灣區(qū)疫情最新消息重慶可靠的關(guān)鍵詞優(yōu)化研發(fā)
一、概念
#include <stdio.h> 稱為編譯預(yù)處理命令,它在告訴C編譯器在編譯時包含stdio.h文件,如果在代碼中,調(diào)用了這個頭文件中的函數(shù)或者宏定義,則需引用該頭文件。
二、作用
stdio.h是c語言中的標(biāo)準(zhǔn)輸入輸出的頭文件,該文件中定義了c語言編譯環(huán)境下的可以調(diào)用的標(biāo)準(zhǔn)函數(shù),部分標(biāo)準(zhǔn)函數(shù)如下:
int getchar() //從標(biāo)準(zhǔn)輸入獲取一個字符
int putchar() //將一個字符輸出到標(biāo)準(zhǔn)輸出
int scanf(char*fromat[,argument...]) //從標(biāo)準(zhǔn)輸入設(shè)備讀入格式化后的數(shù)據(jù)
int printf(char*fromat[,argument...]) //將格式化的數(shù)據(jù)打印到標(biāo)準(zhǔn)輸出
char gets(char*string) //從標(biāo)準(zhǔn)輸入獲取一個字符串
int puts(char*string) // 將一個字符串輸出到標(biāo)準(zhǔn)輸出
int sprintf(char*string,char*format[,...]) //把格式化的數(shù)據(jù)寫入某個字符串緩沖區(qū)
三、舉例
# include <stdio.h>
int main(){//使用printf函數(shù)來打印輸出信息到屏幕 printf("hello c++");return 0;
}
四、常見頭文件
#include <assert.h> //設(shè)定插入點
#include <ctype.h> //字符處理
#include <errno.h> //定義錯誤碼
#include <float.h> //浮點數(shù)處理
#include <fstream.h> //文件輸入/輸出
#include <iomanip.h> //參數(shù)化輸入/輸出
#include <iostream.h> //數(shù)據(jù)流輸入/輸出
#include <limits.h> //定義各種數(shù)據(jù)類型最值常量
#include <locale.h> //定義本地化函數(shù)
#include <math.h> //定義數(shù)學(xué)函數(shù)
#include <stdlib.h> //定義雜項函數(shù)及內(nèi)存分配函數(shù)
#include <string.h> //字符串處理
#include <strstrea.h> //基于數(shù)組的輸入/輸出
#include <time.h> //定義關(guān)于時間的函數(shù)
#include <wchar.h> //寬字符處理及輸入/輸出
#include <wctype.h> //寬字符分類