V
viza
Hi all
Can one reliably call a function via a function pointer of different type
as below?
struct some_struct {
int some_int;
};
int some_function( struct some_struct *struct_ptr ){
return struct_ptr-> some_int;
}
int main( void ){
struct some_struct a_struct= { 42 };
int (*function_pointer)(void*)= & some_function;
return (*function_pointer)( & a_struct );
}
Thanks,
viza
Can one reliably call a function via a function pointer of different type
as below?
struct some_struct {
int some_int;
};
int some_function( struct some_struct *struct_ptr ){
return struct_ptr-> some_int;
}
int main( void ){
struct some_struct a_struct= { 42 };
int (*function_pointer)(void*)= & some_function;
return (*function_pointer)( & a_struct );
}
Thanks,
viza