putw,getw函数问题
putw(int i,FLIE *fp){char *s;s=&i;putc(s[0],fp);putc(s[1],fp);return(i);}getw(FLIE *fp){char *s;int i;s=char *&i;/*不懂,这是什么意思?*/s[0]=getc(fp);s[1]=getc(fp);return(i);}int __cdecl _getw ( FILE *str ){ REG1 FILE *stream; REG2 int bytecount = sizeof(int); int word; char *byteptr = (char *)&word; //注意这句 int retval; _VALIDATE_RETURN((str != NULL), EINVAL, EOF); /* Init stream pointer */ stream = str; _lock_str(stream); __try { while (bytecount--) *byteptr++ = (char)_getc_nolock(stream); retval = ((feof(stream) || ferror(stream)) ? EOF : word); } __finally { _unlock_str(stream); } return(retval);}