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

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -