Hi there i'm working on an assignment at the moment now as far as getting a full answer i am not looking for. I would like some hints or maybe a reference to something that i could learn off of to complete a question i'm stuck on.
a. Write the definition of the function setZero that initializes any one dimensional array of type int to 0.
Maybe i am not following the question properly, but from my understanding I have a function prototype setZero. That does not necessarily need an input or output.
It also says any one dimensional array and therefore i would need the user to create or input a value for the number of elements in this 1D array. The initializing to zero is the easy part. Getting a user to be able to create the size of an array through input is the confusing part.
Heres my general idea.
int i, size;
printf("Enter how many elements you would like in an array");
int zeroArray[i] = 0;
printf("zeroArray[%d] = %d\n", i, zeroArray[i]);