how to pass typedef pointers to functions?

Posted By: MPQ

how to pass typedef pointers to functions? - 08/03/13 12:59

hi,

got the following problem:

I want to pass a typedef pointer in the following way


Code:
MY_TYPEDEF_set (my_typedef)



Code:
void MY_TYPEDEF_set (MY_TYPEDEF *temp) {
  //do anything
}



but I receive an empty pointer error of the engine. Can anybody tell me how I can get it workin?
Posted By: Ch40zzC0d3r

Re: how to pass typedef pointers to functions? - 08/03/13 14:50

Is my_typedef already a pointer?
If not use &my_typedef to pass the pointer and not the data..
Also please post a bit more code!
Posted By: MPQ

Re: how to pass typedef pointers to functions? - 08/03/13 15:08

sry, my_typedef is already a pointer

MY_TYPEDEF *my_typedef = malloc(...)

Posted By: WretchedSid

Re: how to pass typedef pointers to functions? - 08/03/13 15:43

The few lines you have shown so far are utterly meaningless to anyone here. If you don't want us to guess, please provide a short, self contained, correct (compilable), example.

PS: People should also stop writing me PMs so I no longer have to see these threads after reading them
Posted By: MPQ

Re: how to pass typedef pointers to functions? - 08/03/13 16:27

thank you guys, the code is correct, the actual problem hasn't been the passing of the parameter, sorry my mistake!
© 2024 lite-C Forums