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?
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?