I have always read that in order to modify any variable inside a function in C, you must pass a pointer to that variable.
If I want to delete a particular element in a linked list, and I do something like:
int DeleteElement(element **head, element *deleteMe)
{
free(deleteMe);
return 1;
}
Why am I able to free that deleteMe and that gets reflected outside the DeleteElement function? Isn't the deleteMe another thing inside the function?
Thanks