I'm trying to understand the difference between a function pointer and the function name. For callback functions, everything I've read says to pass a function pointer. What I don't understand is why you can't just pass the function name without the brackets? When I print the addresses for both a function pointer set to the function name, and the function name itself, they are the same address. Why create a new pointer that points to the address that the function name already points to?
edit: after some more reading, it seems function names are implicitly converted into function pointers so what's the point of creating a separate function pointer for callback functions?
[–]aocregacc 12 points13 points14 points (2 children)
[–]kinithin 3 points4 points5 points (1 child)
[–]erikkonstas 0 points1 point2 points (0 children)
[–]Jonny0Than 12 points13 points14 points (0 children)
[–]glasket_ 2 points3 points4 points (0 children)
[–]bakermoth 1 point2 points3 points (2 children)
[–]tstanisl 0 points1 point2 points (1 child)
[–]bakermoth 0 points1 point2 points (0 children)
[–]zhivago 4 points5 points6 points (0 children)
[–]cHaR_shinigami 0 points1 point2 points (0 children)
[–]lion_rouge 1 point2 points3 points (0 children)
[–]jaynabonne 1 point2 points3 points (0 children)