What is the size of input for finding X in an array?
Answers
Answered by
2
Answer:
Use variable to pass the size of array.
int sizeof_b = sizeof(b) / sizeof(b[0]); does nothing but getting the pre-declared array size, which is known, and you could have passed it as an argument; for instance, void print_array(int*b, int size) . size could be the user-defined size too.
Answered by
1
Answer:
Use variable to pass the size of array.
int sizeof_b = sizeof(b) / sizeof(b[0]); does nothing but getting the pre-declared array size, which is known, and you could have passed it as an argument; for instance, void print_array(int*b, int size) . size could be the user-defined size Use variable to pass the size of array
Similar questions