Click here to Skip to main content
15,867,756 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
Hi, I am new to c++. Only been doing it for a few days and I am enjoying it very much.

I am getting this error on one of my practice codes I'm writing.

syntax error : missing ';' before 'string'

and

syntax error : missing ';' before identifier 'cin'

but i dont see a spot where i missed ending the line

here is my code

C++
syntax error : missing ';' before identifier 'cin'
Posted
Comments
Maciej Los 11-Aug-13 18:20pm    
Have a look line up. Do you see ";"? If not, please add it.
Ron Beyer 11-Aug-13 18:20pm    
How can we tell if you don't show us the code? The error is exactly what it means, you are missing a ; somewhere, but we can't see your screen, or access your computer, so we can't help.
RSpates 11-Aug-13 20:58pm    
You're missing 'using namespace std;'...
CPallini 12-Aug-13 6:30am    
That isn't your code. Please post your actual code.

1 solution

The C-compiler needs every command to be ended with a ";". So check if you missed one. Avoid using "keywords" and used names like for functions. It only brings errors and confusion.

you better show the code that you have written.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900