Tuesday, July 14, 2009

C++ problem....?

I have this C++ program but when I try to compile it,it says "error C2143: syntax error : missing ';' before '}'"





#include %26lt;iostream%26gt;


using namespace std;





int main()


{


int x = 7;


cout%26lt;%26lt;"try to figure out where are the errors !!!"%26lt;%26lt;endl;


cout%26lt;%26lt;x%26lt;%26lt;endl;


//this is a comment


cout%26lt;%26lt;"bye bye";


cout%26lt;%26lt;"don't forget to solve errors"





}





what am I doing wrong ?

C++ problem....?
Add a semicolon ";" to the end of last line i.e. before the "}" and then recompile.





cout%26lt;%26lt;"don't forget to solve errors";





Hope it helps :)
Reply:cout%26lt;%26lt;"don't forget to solve errors"


semicolon is missing there at the end . :)
Reply:You are missing a ";" after cout%26lt;%26lt;"don't forget to solve errors"
Reply:Put a ; after cout%26lt;%26lt;"don't forget to solve errors"


No comments:

Post a Comment