arrays - Delete the content of a int * in C -


if have array one:

int * array = ... 

and if want delete it's content, fastest , efficient way in c ?

if "deleting content" mean zeroing out array, using memset should work:

size_t element_count = ... // defines how many elements array has memset(array, 0, sizeof(int) * element_count); 

note having pointer array , no additional information insufficient: need provide number of array elements well, because not possible derive information pointer itself.


Comments

Popular posts from this blog

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -