非常棘手的问题,stdafx.h不存在的问题。
关于#include "stdafx.h"的问题
调试时总是出现这样的错误(stdafx.h不存在),怎么解决?'stdafx.h'文件在哪?谢谢!
我的工程是:win32 console application 在CPP文件中的代码如下:这个是操作系统的进程调度的代码,是上网找来的。
#include "stdafx.h"
#include"iostream.h"
const m=100;
struct node{
int data1;//到达时间;
int data2;//完成时间;
int length;//作业长度;
}a[m];
int i=0;
void push(int d1,int d2,int l)
{
a.data1=d1;
a.data2=d2;
a.length=l;
i++;
}
int pop(int j)
{
int y;
if(j>=m)
return 0;
y=a[j].data2-a[j].data1;
a[j+1].data2+=a[j].data2;
cout< return 1;
}
void f()
{
int j,k;node t;
for(j=0;j for(k=0;k if(a[k].length>a[k+1].length)
{
t=a[k];
a[k]=a[k+1];
a[k+1]=t;
}
}
void main()
{
int x,y,d1,d2,l1,k;
cout<<"输入进程个数:";
cin>>k;
if(k for(x=0;x {
cin>>d1>>d2>>l1;
push(d1,d2,l1);
}
f();
for(y=0;y pop(y);
}
C:\Program Files\Microsoft Visual Studio\MyProjects\43454545\3.cpp(1) : fatal error C1083: Cannot open include file: 'stdafx.h': No such file or directory
我自己也去网上找了个stdafx.h放在VC98的include目录下,可是编译的时候另一个问题又出现了
c:\program files\microsoft visual studio\vc98\include\wspiapi.h(45) : error C2265: '<Unknown>' : reference to a zero-sized array is illegal
执行 cl.exe 时出错.
在线等,大家帮帮我。