Monday, May 24, 2010

I have a doubt in c++ program?

i have an error in c++ program.......its coming as an error 4 all the programs......the error is "fatal..\INCLUDE\CONIO%26gt;H 165: error directive: must use c++ for the type iostream". so wat correction am i supposed to make?

I have a doubt in c++ program?
I think you wrote a program as C++, but saved the file as a C file. For example, instead of naming the file MyProg.cpp, you called it MyProg.c. The compiler uses the file extension to determine if the program is a C program or a C++ program.
Reply:it is the error of your header files......either your library is corrupter or you need to set ur path by going in DOS shell.........
Reply:I wish you had provided your code because this looks like a relatively simple problem but wihtout your code it can be many types of things but one thing is for certain, thre previous responder (above this comment) is wrong in saying the file could be corrupt (that is just silly).....





Could you paste your code so i can take a look? Also it might be possible that your dev environment is set up to think its C specific or C++ (depending on which type you are trying to compile in)..





you should have either (or both):





#include %26lt;conio%26gt;


#include %26lt;iostream%26gt;





Notice you dont need to mention the ".h" extension for the conio portion if you are working with C++ code....And notice i didn't give the path to the library...the system knows where theya re already.


No comments:

Post a Comment