What is the C equivalent of C++
delete[] (char *) foo->bar;
Edit: I'm converting some C++ code to ANSI C. And it had:
typedef struct keyvalue
{
char *key;
void *value;
struct keyvalue *next;
} keyvalue_rec;
// ...
for (
ptr = this->_properties->next, last = this->_properties;
ptr!=NULL;
last = ptr, ptr = ptr->next)
{
delete[] last->key;
delete[] (char *) last->value;
delete last;
}
Would this do it for C?
free(last->key);
free(last->value);
free(last)