1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
#include <stdio.h> #include <stdlib.h> #include <string.h> char *strdup(char *); int main() { char *x = "dump", *a; a = strdup(x); return 0; } char *strdup(char *s) { char *np; np = (char *) malloc(strlen(s) + 1); strcpy(np, s); return np; }
1 2
Line 5: error: expected identifier or '(' before '__extension__' Line 15: error: expected identifier or '(' before '__extension__'