#include <stdio.h>
int foo(int i) {
printf("executing %s(%d)\n", __func__
, i
); // we called bar(), but function is still named "foo" return i*i;
}
int main(void) {
int (*bar)(int) = foo; // provide an alias to foo
int foo; // shadow the foo identifier
foo = bar(4); // foo is an int, call the function through the alias
printf("4^2 is %d\n", foo
); // foo is still an int }
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgZm9vKGludCBpKSB7CiAgICBwcmludGYoImV4ZWN1dGluZyAlcyglZClcbiIsIF9fZnVuY19fLCBpKTsgLy8gd2UgY2FsbGVkIGJhcigpLCBidXQgZnVuY3Rpb24gaXMgc3RpbGwgbmFtZWQgImZvbyIKICAgIHJldHVybiBpKmk7Cn0KCmludCBtYWluKHZvaWQpIHsKICAgIGludCAoKmJhcikoaW50KSA9IGZvbzsgICAgICAvLyBwcm92aWRlIGFuIGFsaWFzIHRvIGZvbwogICAgaW50IGZvbzsgICAgICAgICAgICAgICAgICAgIC8vIHNoYWRvdyB0aGUgZm9vIGlkZW50aWZpZXIKICAgIGZvbyA9IGJhcig0KTsgICAgICAgICAgICAgICAvLyBmb28gaXMgYW4gaW50LCBjYWxsIHRoZSBmdW5jdGlvbiB0aHJvdWdoIHRoZSBhbGlhcwogICAgcHJpbnRmKCI0XjIgaXMgJWRcbiIsIGZvbyk7IC8vIGZvbyBpcyBzdGlsbCBhbiBpbnQKfQo=