Unknown parameter in array
Hi,I am using an array of type integer as an argument in a function,
我用函数中整型数组的形参
e.g. void Function(iaaArray[][45]){}
例如 void Function(iaaArray[][45]){}
What I would like to do is have something like...
我想好做就是
void Function(iaaArray[][iInt]){}
where iInt is an integer determined by the user.
用户在那里自定义整形iTnt
So I can allow for different sized arrays to be passed into the function.
所以我允许对可变数组,将其传递到函数
Can someone help me with this.
有那些人帮我做那些
Thanks Krahl
firedraco (3539) Jan 6, 2011 at 11:45am
Take the array as a pointer and pass the size separately:
以数组的大小,并把指针分别:
void func(int* array, unsigned int size)
PS:不知道是不是这样翻译