Nothing happened after array element assignment

 
Why myarray[0]==0 after myarray[0]=123?



int init()
{
//----
int myarray[];
int test;
myarray[0]=123;
Print (myarray[0]); //---------------- result: 0
test=456;
Print (test); //---------------- result: 456
//----
return(0);
}

 
Why myarray[0]==0 after myarray[0]=123?



int init()
{
//----

//Try to initialise array like this:
int myarray[1]; //Array size 1
// or
int myarray[];
ArrayResize(myarray, 1);
// That should work

int test;
myarray[0]=123;
Print (myarray[0]); //---------------- result: 0
test=456;
Print (test); //---------------- result: 456
//----
return(0);
}

 
Why myarray[0]==0 after myarray[0]=123?



int init()
{
//----

//Try to initialise array like this:
int myarray[1]; //Array size 1
// or
int myarray[];
ArrayResize(myarray, 1);
// That should work

int test;
myarray[0]=123;
Print (myarray[0]); //---------------- result: 0
test=456;
Print (test); //---------------- result: 456
//----
return(0);
}







Thanks.
Reason: