I'm getting an error msg as Type mismatch in redeclaration of 'putw' for the following code... Can anyone suggest the reason for this???
#include<stdio.h>
union pw{
short int i;
char ch[2];
};
int putw(short int num, FILE *fp);
int main()
{
FILE *fp;
fp=fopen("test.tmp","wb+");
putw(1000,fp);
fclose(fp);
return 0;
}
int putw(short int num, FILE *fp)
{
union pw word;
word.i=num;
putc(word.ch[0],fp);
return putc(word.ch[1],fp);
}