Is there any equivalent to memset?

  • Thread starter Thread starter ThunderMusic
  • Start date Start date
T

ThunderMusic

Hi,
I want to know if there is an equivalent to memset but in .NET. I know there
is System.Buffer.SetByte, but it only works on arrays. I have a structure
and in some example codes I found, they initialize this structure to zero
with memset like this to make sure not garbage is taken from the memory not
being erased properly :

TheStruct StructVar;
memset (StructVar, 0, sizeof(StructVar));

Is there an equivalent or simply I don't have to do that anymore in .NET?

Thanks

ThunderMusic
 
The default parameterless constructor of the structure should set
everything to its default values, which should be equivalent to
ZeroMemory.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top