27.01.2011, 23:44
I currently have an array such as this:
(Note that all values are just random for the purpose of this post)
How do I call it in a function and then loop through all the values, such as:
I have tried defining it as
The above does allow me to pass the array into the function, however since there is no definate size of the passed array, it causes errors when trying to read the values with a loop. Since, I can't use sizeof(), I don't know how I can read all of the values Of an undetermined array size.
If I make it loop through a set number of times:
the server crashes when i == 6
Basically, How do I get all the values from a multi dimensional array when the array that is passed can differ in size?
Code:
new Float:Hello[6][2] = { {1234.1211,1854.0146}, {1564.4543,1564.1547}, {1224.4215,1511.1113}, {1133.1123,1112.4148}, {1134.8743,1644.1546}, {1154.4445,2124.1544} };
How do I call it in a function and then loop through all the values, such as:
Code:
public Random(Hello) { }
Code:
public Random(Float:RandomVariable[][]) { }
If I make it loop through a set number of times:
Code:
public Random(Float:RandomVariable[][]) { for(new i=0;i < 10;i++) { printf("%d - %f,%f",i,RandomVariable[i][0],RandomVariable[i][1]); } print("HELLO"); }
Basically, How do I get all the values from a multi dimensional array when the array that is passed can differ in size?