忽略scanf的返回值要怎么改 c語言中scanf語句如何換行?
c語言中scanf語句如何換行?scanf如何用C語言實(shí)現(xiàn)連續(xù)換行輸入:#include<stdio。H>int main(){int valuewhile(scanf(%d“,&val
c語言中scanf語句如何換行?
scanf如何用C語言實(shí)現(xiàn)連續(xù)換行輸入:
#include<stdio。H>
int main(){
int value
while(scanf(%d“,&value)!=EOF){//連續(xù)換行輸入值
//要執(zhí)行的代碼
}
]返回0
}]scanf函數(shù)原型:int scanf(const char)*Format,…
返回值:scanf()函數(shù)返回成功分配的數(shù)據(jù)項(xiàng)數(shù),當(dāng)文件結(jié)尾出現(xiàn)錯誤時返回EOF。(EOF值為-1)。
調(diào)用:其調(diào)用形式為:scanf(“< format description string>”,< variable address>)變量地址必須有效并與格式描述的順序一致。