Created
November 16, 2012 08:41
-
-
Save Javran/4085548 to your computer and use it in GitHub Desktop.
function/variable screening in c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
typedef void (*ft) (const char *); | |
ft f; | |
void print1(const char *a) { | |
printf("#1 -> %s\n", a); | |
} | |
void print2(const char *a) { | |
printf("#2 -> %s\n", a); | |
} | |
int main() | |
{ | |
char a[] = "aaaa"; | |
ft f = print1; | |
f(a); | |
{ | |
f(a); | |
char a[] = "bbbb"; | |
f(a); | |
ft f = print2; | |
f(a); | |
} | |
f(a); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment