Question: How would you go about writing a function size _ t number _ of _ numbers ( int * numbers ) , to determine the

How would you go about writing a function size_t number_of_numbers(int* numbers), to determine the size of a dynamically-allocated array of ints?
A: Every array carries its size, so you can just return numbers->size.
B: You can use sizeof() to find the size of an array.
C: You can't do that, since C passes arrays as pointers to the initial element of the array.
D: Start at the beginning of the array and walk through the elements until you find a null element.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!