Expected ‘ , ‘ or ‘ ; ‘ error in C++ [ Solved ]

0
21

This error can occur because of 2 reasons.

  1. You are missing semicolon ( ; ) somewhere.
  2. You are missing comma ( , ) somewhere between declaring variables.

Reason 1. You are missing semicolon somewhere in program.

When you forget to put a semicolon at the end of a statement then this error can occur in your program. See the example below.

expected , or ; c++

Reason 2. You are missing comma ( , ) somewhere between declaring variables.

Sometimes you may forget a comma when you declare more than one variables in one line. This can also cause this error in you program. See example below.

C++ Error missing semicolon

To solve this error make sure you are not missing semicolon and comma in you program.

LEAVE A REPLY

Please enter your comment!
Please enter your name here