+ 1
how to count all pointers and variables that using an dynamically allocated memory with malloc and new ?
if we override malloc and new function we can track first created pointer . but how can i track and count other pointers and functions that using this allocated memory ? should i override Assignment operator and function call ? if yes how ?
1 ответ
0
An inbuilt function malloc is used to dynamically assign memory to pointers. This function is available in stdlib. h header file. The memory needed for the pointer is given as argument to this function and malloc allocates that much memory block to the pointer variable.