Issue
if(...) {
...
}
It seems in the above case a ;
is optional,when is a semicolon after }
necessary in c/c++?
Solution
int a[2] = {1,2}, j = 5;
When initialization of array or structure are done with {}
all the subsequent variables are declared after ,
.
Edit: As you changed your question; ;
is mandatory after the class
, enum
, initialization syntax declarations.
class A {}; // same for `struct
enum E {}; // enum class (c++0x)
int a[] = {1,2}; // array or object initialization
And as per comment by @rubenvb:
do {} while(condition);
Answered By - iammilind Answer Checked By - Clifford M. (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.