this is the slogan:
Write a function to add an element to the end of a vector. where v is the vector to add an element to, n is the maximum length of vector v, util is a pointer to the variable that stores the number of currently used elements of v, and elem is the element to add. The function should add elem to the end of the used elements of vector v, and increment the value of the variable pointed to by util by 1. The function should return zero if it was able to successfully add the element, and 1 in the case that vector v is full and the element cannot be added to the array.
and this what I did:
int agregar(int v[], int n, int* util, int elem){
// Programar la funcion aqui
for(n=0; n<*util; n++) {
v[n]=elem;
n=n+1;
return 0;
}
return 1;
}
my question is to know if the slogan is well raised and how to test my code with a vector?