I'm trying to find the length of an array with the code below, but when I'm trying to run it inside of a function, it doesn't work right.
int nums1 []={1,2,3,4,5,6,7,8,9,10};
const int len1=sizeof(nums1)/sizeof(nums1[0]);
When I'm passing nums1
to the function and then trying to find the length of nums1
, same code doesn't work right.
This is my codes and what I get as a result: