Question: Why will the following array definition fail to reserve storage? float weights[]; The following array definition will fail to reserve storage because it hasn't been

Why will the following array definition fail to reserve storage? float weights[]; The following array definition will fail to reserve storage because it hasn't been assigned a number of arrav elements, so for it to be successful it should look like: float weight[8]:

Sol158:

Just a minor correction: the array definition should include square brackets, not a colon, to specify the number of elements. So it should look like: float weights[]; should be changed to float weights[8]; in order to reserve storage for 8 elements.

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 Programming Questions!