Hi there C /C++ experts...
I have a confusion regarding the function free(void *) in C and delete in C++. Suppose there is a pointer named p. In C++, we dynamically allocate memory for p to point at like this
p = new int .
,then when we use
, in typical situations only the memory space for p gets deallocated. And when we use
p then all the memory space from p to p gets deallocated. I know that in C we use calloc() and malloc() to allocate memory dynamically and use free() to dellocate. Now, is this free() equivalent to delete or delete? That is does it deallocate memory space for only p or all the memory space from p to p?????