In my code I have a struc
struct Test {
int a;
int b;
char c;
};
With my function:
int TestFunction(void* ptr){
struct Test test;
test.a = 0;
test.b = 1;
strcpy(c,"hello");
return 0;
}
Now to link the temp struc to the void ptr I passed in I have
struct Test* temp = (struct Test*)ptr;
struct Test test = *temp;
Is this the correct way to link strucs with void ptrs? Is there an easier way?