c - Function pointers and necessity -


this question has answer here:

i interested in cracking minute things in c.

function pointer:

from know, function pointer nothing more c variable points address of function normal c variable. can call function using pointer also.

questions:

  1. what necessity of using function pointers rather using functions alone?
  2. will advanced thing normal function cannot do?

according wikipedia, “in computer programming, callback reference executable code, or piece of executable code, passed argument other code. allows lower-level software layer call subroutine (or function) defined in higher-level layer.”

  1. in c callbacks implemented using function pointers. example, see link.

  2. can normal function take function 1 of arguments ? callback advanced thing in sense , function pointers implement them.

further, use case explained here.


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -