Okay so I have this program of mine:
#include <unistd.h>
#include <stdio.h>
int deCode(int x[2][5])
{
return x[2][4]; // Heres where the "garbage" comes in.
} // calling x[2][4] is non valued function. I can call [0,1][0,1,2,3,4]
int main(void)
{
int newPosition;
int x[2][5]={
{1,3,5,7,9}, //[0][0-4] // row 0
{2,4,6,8,10} //[1][0-4] // row 1
}; //NOTICE NO ROW 2
printf("%d\n", deCode(&x));
}
I got value 1 when I play this program. Obviously you probably wont get the same resolut. when i do [2][1,2,3,5] I get true garbage. Im just wondering is that like one in a million chance or am I missing something?