-
-
Save LambdaP/6973214 to your computer and use it in GitHub Desktop.
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> | |
int f(int, int); | |
int g(int); | |
int func(int, int); | |
int f(a,b) | |
{ | |
int a, b; | |
return a*b; | |
} | |
int g(a) | |
{ | |
int a; | |
return -a+1; | |
} | |
int func(a,b) | |
{ | |
int a, b; | |
int c, d; | |
return (c = a+b, d = f(a,c), g(d)); | |
} | |
int main(void) | |
{ | |
printf("%d\n", func(3,4)); | |
} | |
=================================================== | |
cc a.c -o a | |
a.c: In function ‘f’: | |
a.c:9:13: erreur: ‘a’ redeclared as different kind of symbol | |
int a, b; | |
^ | |
a.c:7:5: note: previous definition of ‘a’ was here | |
int f(a,b) | |
^ | |
a.c:9:16: erreur: ‘b’ redeclared as different kind of symbol | |
int a, b; | |
^ | |
a.c:7:5: note: previous definition of ‘b’ was here | |
int f(a,b) | |
^ | |
a.c: In function ‘g’: | |
a.c:16:13: erreur: ‘a’ redeclared as different kind of symbol | |
int a; | |
^ | |
a.c:14:5: note: previous definition of ‘a’ was here | |
int g(a) | |
^ | |
a.c: In function ‘func’: | |
a.c:23:13: erreur: ‘a’ redeclared as different kind of symbol | |
int a, b; | |
^ | |
a.c:21:5: note: previous definition of ‘a’ was here | |
int func(a,b) | |
^ | |
a.c:23:16: erreur: ‘b’ redeclared as different kind of symbol | |
int a, b; | |
^ | |
a.c:21:5: note: previous definition of ‘b’ was here | |
int func(a,b) | |
^ | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment