|
Casual Adventurer |
Joined: Sat, 26 Jul 2014 22:29 Posts: 15
|
Hello everyone.
I was trying to find a way to pass an array as a parameter to a function in AGS and it turned out to be an exercise in frustration, so I simply wanted to share that experience with you and hopefully spare someone else.
Lets say you have a function like this: function boo(int x[]) { //code goes here }
If you try to call it like this it will fail with a "Type mismatch: cannot convert int* to int[]" error: int my_x[10]; boo(my_x);
The correct way to call this is: int my_x[] = new int[10]; boo(my_x);
Just FYI in case you need it at some point
|
|