c - How should I type cast void *? -
i learning c. need define function type cast value of void *
desired type. i'm not sure if understand need do. here attempt. can take , let me know if it's correct? if not, how should fix it? thank in advance time.
void print_type(type a) { void *v_ptr; v_ptr = &a; }
in c, void *
implicitly compatible data pointer type. if have posix implementation, it's compatible function pointers well. there's no need typecasting; conversely, it's considered harmful.
Comments
Post a Comment