I've got a char array
and i allocate memory for a number of elemetsCode:char *vec;
i do that in main.Code:vec = (char*) malloc ((sizeof(char))*(number_of_elemets));
then i call a free function
the function code is:Code:free_mem (vec);
it gives me errorsCode:void free_mem (char *vec,number_of _elements)
{
for (i=0;i<(number_of _elements);i++)
{
free (vec[i]);
}
}
what's wrong?
thanks!!