#include <stdio.h>
int main()
{
int c=10, d=20;
void swap(int *c, int *d);
void change(int *c, int *d);
printf("Before swap c=%d , d=%d ,", c,d);
swap(&c,&d);
printf("After swap c=%d , d=%d ,", c,d);
}
void swap(int *c, int *d)
{
change(&c,d);
}
void change(int *c, int *d)
{
int t;
t=**c;
**c=*d;
*d=t;
}
I am getting a compilation error
kan1usp4.c:19: warning: type mismatch with previous implicit declaration
kan1usp4.c:15: warning: previous implicit declaration of `change'
kan1usp4.c:19: warning: `change' was previously implicitly declared to return `
nt'
kan1usp4.c: In function `change':
kan1usp4.c:21: invalid type argument of `unary *'
kan1usp4.c:22: invalid type argument of `unary *'
On the face of it the program looks fine. But, then why is the compilation error.
Thanks..Jack.