常用EOF判別式
gets(input) != NULL
scanf(%s,input) != EOF
輸入格式
gets():一律視為一個字串
scanf():空格分離字串
換行
gets():輸入完畢自動換行
scanf():同上
常用EOF判別式
gets(input) != NULL
scanf(%s,input) != EOF
輸入格式
gets():一律視為一個字串
scanf():空格分離字串
換行
gets():輸入完畢自動換行
scanf():同上
現在更喜歡用 scanf(%s,input) = 1 這樣的寫法呢 =w=
gets通常會被 compiler 警告,
所以我更常用 fgets(str, size, stdin)
不過 fgets(str, size, stdin) 會將 ‘\n’ 也讀進來
其實我只是想借機會測試頭像有沒有用成功XD
Leave a Reply