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

How can we post XML strings along with text strings in iOS -

How to run C# code using mono without Xamarin in Android? -

c# - cefsharp app remember password option -