...
Code Block | ||
---|---|---|
| ||
#include <stdio.h>
extern char *strchr();
char *(*fp) ();
int main(void) {
char *c;
fp = strchr;
c = fp(12,2);
printf("%s\n",c);
}
|
Compliant Solution: (function pointers)
Code Block | ||
---|---|---|
| ||
extern char *strchr();#include <string.h> char *(*fp) (cjar *,int); int main(void) { char *c; fp = strchr; c = fp(12,2"Hello",'H'); printf("%s\n",c); } |
Non-Compliant Code Example: (variadic functions)
...