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

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -