i don't know why below code occur error :"uninitialized local variable 'add' used" at line 11
actually i have initialize add as a double array~ ~
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
usingnamespace std;
# define happy__declspec (dllexport)
happy int __stdcall passV(bool Do_SL,double XP[12],double Support[3] ); // declare passV is exist in my dll
happy int __stdcall passV(bool Do_SL,double XP[12],double Support[3] )
{
double add[12] ;
add[12] = 0 ,-4 , -5 , -6 ,-9 ,-12, -16,-31 ,-32 ,-34 ,-37 ;
double test98 = add[2] ; // test98 should be -5
}
it is part of my code , but i think it's aleady give you enough hints to tell what/where the mistake is~ ~
Will set the 13th element (which doesn't exists) to -37, the way using braces work only as initialization, not as assignment: double add[12] = { 0 ,-4 , -5 , -6 ,-9 ,-12, -16,-31 ,-32 ,-34 ,-37 };