+ 2

Can we use an array as a parameter of a function?

26th Nov 2016, 4:42 PM
GPriya
GPriya - avatar
3 ответов
+ 5
hello, Take a look at this. It describes in depth. https://www.tutorialspoint.com/cplusplus/cpp_passing_arrays_to_functions.htm
26th Nov 2016, 4:52 PM
Vishal Koshti
Vishal Koshti - avatar
+ 3
ok thanks.. got it
26th Nov 2016, 5:39 PM
GPriya
GPriya - avatar
+ 2
Yes, you can but like void myfunc(int a[],int something) { //your code goes here } and your calling that function like this int b={1,4,2,7}; myfunc(b,b.size());
26th Nov 2016, 4:52 PM
Aditya kumar pandey
Aditya kumar pandey - avatar