Expected initializer before numeric constant

From Cppsyntax

Jump to: navigation, search

You can get the error

 expected initializer before numeric constant

if you forget an equals sign.

WRONG

 void foo()
 {
   int i 2;        // no =!
 }

RIGHT

 void foo()
 {
   int i = 2;        // ahhh, better!
 }
Personal tools