为什么总是显示乱码呀!
#include <iostream>#include <stdio.h>
#include <stdlib.h>
#include <string.h>
FILE *fp;
void main()
{
int i;
char ch;
char str[200];
i=0;
if ((fp=fopen("E:\\book.csv","r"))==NULL)
{printf("Cannot open this file.\n");
exit(0);
}
ch=fgetc(fp);
while(ch!=EOF)
{putchar(ch);
ch=str[i];
printf("%c",str[i]);
//if(str[i]=",")
i++;
ch=fgetc(fp);
}
printf("%d\n",i);
}
求大侠们帮我看看,为嘛老是出乱码!!