c语言:为什么将d盘改成c盘输出窗口就会一闪而过,明明都有system(“pause”);在别的电脑却可以

#include <stdio.h>
#include <string.h>
#include<stdlib.h>
main()
{ char a,str[80]= "The quick brown fox jumps over a lazy dog.";
FILE *fp;
int i=0;
if ((fp=fopen("c:\abc.txt","w+"))==NULL)
{ printf("Cannot open the file!\n"); exit(0); }
while(str[i]) { putc(str[i],fp); i++; }
putc(0xFF,fp);
rewind(fp);
a=getc(fp);
while(a!=EOF) { putchar(a); a=getc(fp); }
putchar('\n');
fclose(fp);
system("pause");
}

跟电脑的操作系统有关,这么改下试试:

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main()      //修改
{
    char a, str[80] = "The quick brown fox jumps over a lazy dog.";
    FILE* fp;
    int i = 0;
    if ((fp = fopen("c:\\abc.txt", "w+")) == NULL) //修改
    {
        printf("Cannot open the file!\n"); //exit(0); 修改
    }
    else{  //修改
        while (str[i]) { putc(str[i], fp); i++; }
        putc(0xFF, fp);
        rewind(fp);
        a = getc(fp);
        while (a != EOF) { putchar(a); a = getc(fp); }
        putchar('\n');
        fclose(fp);
    }
    system("pause");
    return 0;    //修改
}

应该是fp==NULL,直接exit了,至于为什么,自己查一下吧,有可能是权限问题,或者路径错误之类的。
那个文件名,应该写成"c:\\abc.txt"才对吧,