知道怎么用c语言调用csv文件不?
#include <iostream>#include <stdio.h>
#include <stdlib.h>
#include <string.h>
FILE *fp;
void main()
{
char ch;
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=fgetc(fp);
}
fclose(fp);
return 0;
}
知道这里有啥错吗?老显示文件未找到啊#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
FILE *fp;
void main()
{
char ch;
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=fgetc(fp);
}
fclose(fp);
return 0;
}
知道这里有啥错吗?老显示文件未找到啊