我寫了一個小程序,以測試從stdin閱讀文本文件: int main(){
char c;
while(!feof(stdin)){
c = getchar(); //on last iteration, this returns '\n'
if(!isspace(c)) //so this is false
putchar(c)
嗨,我有這個文本文件,其中第二個和第三個字符的第一列是整數..但我無法讀取和打印值correctley。 所以這個文件想讀: c 6
o 4 3
o 2 4
o 3 2
o 1 1
o 3 3
這裏是代碼: #include <stdio.h>
#include <stdlib.h>
#define N 6
int main (int argc, char *argv[])