Memset a struct

Joined
May 4, 2010
Messages
2
Reaction score
0
Hello

I've got a struct in a class in the private field.


Private:
tyepdef struct mystruct
{
char date[10];
char time[10];
char name[20];
} MYSTRUCT;

MYSTRUCT MyStruct;


Then I access it through some setter functions, for each element.

I then have have a function that simply prints out each element of the struct to a file using fprintf. My issue is after I've printed the data, I want to be able to clear it, so I tried to use the memset function
memset(MyStruct, '\0', sizeof(MyStruct));

However when I compile I get the following error error C2664 'memset' : cannot convert parameter 1 from "class1::MYSTRUCT" to 'void*'



Any idea how to fix this or to clear the struct?
 

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

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,521
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top