| | |
Wats the problem in this Prog???
Thread Solved
![]() |
•
•
Join Date: Aug 2008
Posts: 42
Reputation:
Solved Threads: 4
I'm getting an error msg as Type mismatch in redeclaration of 'putw' for the following code... Can anyone suggest the reason for this???
C Syntax (Toggle Plain Text)
#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); }
Last edited by Tekmaven; Aug 4th, 2008 at 6:30 am. Reason: Code tags
Name putw() to something different like putword(). Most likely there's an implementation of putw() already prototyped in your compiler library.
Please, make sure you use proper tags when you post code next time. Here's how.
Please, make sure you use proper tags when you post code next time. Here's how.
Last edited by Aia; Aug 4th, 2008 at 12:12 am.
![]() |
Other Threads in the C Forum
- Previous Thread: anyone knows chip programming with c
- Next Thread: Twin primes
| Thread Tools | Search this Thread |
adobe ansi api array asterisks binarysearch calculate centimeter char character convert copyanyfile copyimagefile copypdffile cprogramme creafecopyofanytypeoffileinc createcopyoffile createprocess() csyntax directory feet fflush file floatingpointvalidation fork forloop frequency givemetehcodez global grade graphics gtkgcurlcompiling hacking highest homework i/o inches infiniteloop interest kernel kilometer km linked linkedlist linux linuxsegmentationfault list locate looping loopinsideloop. match meter microsoft mysql number odf open opendocumentformat openwebfoundation owf pattern pdf performance posix power probleminc process program programming pyramidusingturboccodes radix read recv recvblocked repetition research scanf scheduling segmentationfault send sequential single socket socketprograming socketprogramming stack standard string suggestions systemcall threads turboc unix urboc user variable voidmain() wab win32api windows.h






