从流中读字符进行操作时,提示发生访问冲突。
FILE* cstream, * outstream;
if ((cstream = fopen("d:\\sample.txt", "r")) == NULL)
{
printf("Failed to open sample.txt!");
exit(0);
}
if ((outstream = fopen("d:\\text1.txt", "w")) == NULL)
{
printf("Failed to open text1.txt");
exit(0);
}
for (int i = 0; i <= 15; i++)
{
char ch;
ch = fgetc(cstream);
printf("%s",(char)ch);
}