c - A pointer to a function -
defines a named variable as scary
which is an indicator for a function Which gives an indicator to double the arguments of a single type pointer and reduce it?
Is that correct? Small * (* scary) (double *)
Should googled for " function pointer c " in the first place, but I take your question as a confirmation that you have already studied already .
Yes, that's right, do the following as an example:
small global = 2; Small * ptr_to_global = & amp; Global; Small * scary_fun (double * ptr) {return ptr_to_global; } Int main (zero) {double val = 22.0; Double * ptr_to_val = & amp; Val; Small * (* scary) (double *); Horror = & amp; Scary_fun; Printf ("% d", * (scary (ptr_to_val)); // print "2" return 0; }
Comments
Post a Comment