主题:vc里可以运行,生成exe不能运行
micrsoft visual c++ debug library
debug assertiom failed
program:f:\debug\a.exe
file:fscanf.c
line:54
expression:stream!=null
for information on how your program can cause an assertion failure,see the visual c++ documentation on asserts.
在vc里都能调试运行,但直接点击生成的exe就不行了出现上面的错误提示
#include<windows.h>
#include<stdio.h>
void main()
{
FILE *fp;
char infile[20],outfile[20];
fp=fopen("temp.dat","r");
fscanf(fp,"%s",infile);
fscanf(fp,"%s",outfile);
CopyFile(infile,outfile,FALSE);
fclose(fp);
}
team.dat里是
c:\\file1.txt
f:\\file1.txt两行字
debug assertiom failed
program:f:\debug\a.exe
file:fscanf.c
line:54
expression:stream!=null
for information on how your program can cause an assertion failure,see the visual c++ documentation on asserts.
在vc里都能调试运行,但直接点击生成的exe就不行了出现上面的错误提示
#include<windows.h>
#include<stdio.h>
void main()
{
FILE *fp;
char infile[20],outfile[20];
fp=fopen("temp.dat","r");
fscanf(fp,"%s",infile);
fscanf(fp,"%s",outfile);
CopyFile(infile,outfile,FALSE);
fclose(fp);
}
team.dat里是
c:\\file1.txt
f:\\file1.txt两行字