function: Array initailization

I am trying to write a function that takes 1 dim arrays of various lengths and initializes them to zero.

I am planning to call the function multiple times, to it only has to handle one array at a time.


I have been trying to use these 2 methods:

void setZero(int array1[])
{
for (int row=0;!array1;row++)
{
array1[row]=0
}

//or

void setZero (int array1[])
{
array1[x]={0};
}

does anyone have any suggestions about the '!array' format, or another possible option?
Thanks
Neither version will work.

void zero(int *array,int size);
Yes, as helios said...you MUST pass the size, unless it a null-terminated char*, then you can use strlen()...but other then that, there is no way to know the size.
thanks for the reply
so there is no way to set all values of an array to zero without also passing its size?
sorry... ignore the question, i did not refresh.
Thanks
Topic archived. No new replies allowed.