IP_ADAPTER_INFO *ptr=new IP_ADAPTER_INFO[100];
if I free using
delete ptr;
will it lead to memory leak, if not t
It will usually not leak because in case of POD destructors are trivial and there's no need for invoking them so delete
just deallocates memory occupied by the array. Memory deallocation requires just a pointer value so it will be returned to the heap. The array accopies a contiguous block of memory and so the deallocation can be sucessful just as if it was a deallocation of a single element.
But don't rely on this since it is undefined behaviour. Maybe it works allright, maybe something horrible happens, works on this compiler, doesn't work on another and many people thank you for planting an error.
See this answer for details.