I have this extremely simple main function
#include "stdafx.h"
#include "abc.h"
int _tmain(int argc, _TCHAR* argv[])
{
abc obj;
obj.show();
return 0;
}
Everything is compiling normally...but when i am writing
#include "abc.h"
#include "stdafx.h"
int _tmain(int argc, _TCHAR* argv[])
{
abc obj;
obj.show();
return 0;
}
The compiler is going haywire..
error C2065: 'abc' : undeclared identifier
error C2146: syntax error : missing ';' before identifier 'obj'
error C2065: 'obj' : undeclared identifier
error C2228: left of '.show' must have class/struct/union
type is ''unknown-type''
Why is it mandatory to include
stdafx.h
at the start? I am new in C++ ...maybe I am making a silly mistake. Please help :(
(Using: VS2005 with C++ 98)