How can pointers to functions point to something that doesn't exist in memory yet? Why do prototypes have different addresses?
- by Kacy Raye
To my knowledge, functions do not get added to the stack until run-time after they are called in the main function.
So how can a pointer to a function have a function's memory address if it doesn't exist in memory?
For example:
using namespace std;
#include <iostream>
void func() {
}
int main() {
void (*ptr)() = func;
cout…