Thursday, July 30, 2009

Regarding C++ !!! need Help?

Hi there, well i have downloaded microsoft visual c++ 2005 express edition. and whenever i write program it gives me error. ia m attaching my program and program and please somebody help me.


// unknown


//engr 30





//program 1





#include %26lt;iostream%26gt;


using namespace std;


int main()


{


cout%26lt;%26lt;"Welcome to Engineering 30!\n";


cout%26lt;%26lt;"Have a good day.";


return 0;


}





The error i get





1%26gt;Compiling...


1%26gt;stdafx.cpp


1%26gt;Compiling...


1%26gt;Test program.cpp


1%26gt;c:\documents and settings\hp_administrator\my documents\c++ programs\test program\test program\test program.cpp(16) : fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source?


1%26gt;Build log was saved at "file://c:\Documents and Settings\HP_Administrator\My Documents\C++ Programs\Test program\Test program\Debug\BuildLog.htm"


1%26gt;Test program - 1 error(s), 0 warning(s)


========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

Regarding C++ !!! need Help?
Try starting your project as a "console" application as opposed to a windows application.





EDIT: which happens to uncheck the precompiled headers box automatically ;)
Reply:None of the other answers are correct. What you want to do, is in project properties, uncheck 'using precompiled header' because you are not using one. That is what stdafx.h is for.
Reply:there is no file called iostream in microsoft visual c++





so this error in coming......i suggest u that u first work on turbo c++ then switch to vc++ its will we good for knowing the language well





i hope it helped
Reply:At the risk of stating the obvious, have you tried the '#include "stdafx.h"' they suggest in your error message? It's been awhile since I've done some VC++ but I do recall needing stdafx.h or windows.h in almost all programs I built.

wildflower

No comments:

Post a Comment