Hello!I tried out a program on constructors in VC++ 2008 Express Edition and Turbo C++.On compilation both of them showed 0 errors and 0 warnings.But while running the program VC++ showed:
"fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source?" and failed to run.But Turbo C++ ran the program smoothly and showed the output. Could any one tell me what's the reason behind and how to fix the problem?
My code in VC++:
Code:
#include"stdafx.h"
#include <iostream>
using namespace std;
class integer
{
int m,n;
public:
integer(int,int);
void disp(void)
{
cout<<m<<" "<<n;
}
};
integer::integer(int x, int y)
{
m=x;
n=y;
}
int main()
{
integer int1(0,100);
integer int2=integer(25,75);
cout<<"\nOBJECT1"<<endl;
int1.disp();
cout<<"\nOBJECT2"<<endl;
int2.disp();
return 0;
}