0

Different methods of passing array as arguments?

23rd May 2017, 2:00 PM
shashank
shashank - avatar
4 ответов
+ 3
void pass(int *arr,int len){ } void pass(int arr[],int len){ }
23rd May 2017, 2:05 PM
MR Programmer
MR Programmer - avatar
0
can you give a example of a program
23rd May 2017, 2:09 PM
shashank
shashank - avatar
0
sorry an example for it
23rd May 2017, 2:10 PM
shashank
shashank - avatar
0
template <int SIZE> void f(int (&arr)[SIZE]) { cout << arr[0]; cout << SIZE; } int main() { int arr[] = {1,1,1}; f(arr); // prints 13 return 0; }
23rd May 2017, 2:25 PM
Madera Oxidada
Madera Oxidada - avatar