Hi. what am I doing wrong here. >
#include <stdio.h>
int copy(int a);
int main(void)
{
int num = 5;
int c = 0;
c = copy(num);
printf("num = %d\n", c);
return 0;
}
int copy(int a)
{
int a = num;
return a;
}
gcc gives me the following errors but since I am fairly new I don't understand them
copy.c: In function `copy':
copy.c:19: warning: declaration of `a' shadows a parameter
copy.c:19: `num' undeclared (first use in this function)
copy.c:19: (Each undeclared identifier is reported only once
copy.c:19: for each function it appears in.)
it says 'num' is undeclared but I decalred it in 'main' ...
thanks