萌新请教一下这段代码是哪里有问题?
											 程序代码:
程序代码:
#include <stdio.h>
#define MAX_LINE 1024
int exam()
{
    int ch,num=0;
    char buf[MAX_LINE];
    FILE *fp;
    fp=fopen("1.txt","r");
    ch=getc(fp);
    while(ch!=EOF)
    {
        putchar(ch);
        buf[num]=ch;
        num++;
        ch=getc(fp);
        
    }
    printf("有%d个数据\n",num);
    printf("%d ",buf[num]);
    return 0;
    getchar();//等待
}
其中 txt文件里的数据如下
 
					
				
			运行后运行结果只读取了四个,meiy这是为什么呢?
 
					
				
			
 
											





 
	    

