Are 2D arrays Global?
Posted: Tue Aug 05, 2008 6:19 pm
Ok, my grappling match with arrays goes on and I've started using a 2d array. As these have to be manually set from an actor script, I can't seem to reference them from outside of the actor that defines it. My array is such:
int Grid [3][5] = {
{ 2,1,3,4,3}, // 5 numbers across....
{ 2,4,3,1,2},
{ 1,3,2,4,1}, } // and 3 rows down *(just typed this in from memory, ignore typo's etc)*
How do I now access i.e the value of Grid [3] [3] from elsewhere in the program?
int Grid [3][5] = {
{ 2,1,3,4,3}, // 5 numbers across....
{ 2,4,3,1,2},
{ 1,3,2,4,1}, } // and 3 rows down *(just typed this in from memory, ignore typo's etc)*
How do I now access i.e the value of Grid [3] [3] from elsewhere in the program?