pointer + pointer c code example
Example 1: Function pointer C++
void one() { cout << "One\n"; }
void two() { cout << "Two\n"; }
int main()
{
void (*fptr)(); //Declare a function pointer to voids with no params
fptr = &one; //fptr -> one
*fptr(); //=> one()
fptr = &two; //fptr -> two
*fptr(); //=> two()
return 0;
}
Example 2: How to use pointers in C
myvar = 25;
foo = &myvar;
bar = myvar;