Too many initializers for array in C++ -
Too many initializers for array in C++ -
i trying initialize array in visual c++.
in header file, declaring array this. int pawnsquaretable[64];
in cpp file include header file, initializing array in constructor of class in manner:
pawnsquaretable[64]={0,0,1,2.....64 values};
however, vc++ giving me too many initializer values
error. why happening?
edit: reddish squiggly line underlines sec element of array.
a::a() // : pawnsquaretable{1,2,3,4} // compile in clang/gcc { // msvc, instead int* p = pawnsquaretable; for( int : {1,2,3,4} ) // <- values here *p++=i; }
c++ arrays
Comments
Post a Comment