home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / c / 19260 < prev    next >
Encoding:
Internet Message Format  |  1993-01-05  |  1.1 KB

  1. Path: sparky!uunet!world!ksr!jfw
  2. From: jfw@ksr.com (John F. Woods)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: This will work under unix now
  5. Message-ID: <20650@ksr.com>
  6. Date: 5 Jan 93 12:49:05 EST
  7. References: <1993Jan5.075823.10230jp@tygra.Michigan.COM>
  8. Sender: news@ksr.com
  9. Lines: 25
  10.  
  11. jp@tygra.Michigan.COM (John Palmer) writes:
  12. >Dug this out of the code that I saved from this group (and others).
  13. >It wouldn't work under XENIX/UNIX as you cannot give both variable
  14. >names and their types in the function definition (inside the '()'s)
  15. >---
  16. >#include <stdio.h>
  17. >#include <stdlib.h>
  18. >char * strwrap(char *, int, int);
  19.  
  20. >char * strwrap(s, w, o)
  21. >    char *s;
  22. >    int w,o;
  23. >{
  24.  
  25. If your compiler does not accept a definition like
  26.  
  27.     char * strwrap(char *s, int w, int o)
  28.      { ...
  29.  
  30. then it isn't an ANSI C compiler.  If it claims to be, demand your money back.
  31. (That style is also acceptable for the prototype, as well.)
  32.  
  33. If it doesn't claim to be an ANSI C compiler, consider investing in one.
  34. At any rate, this isn't a "unix" issue, since fully-compliant ANSI C compilers
  35. for UNIX are a dime a dozen.
  36.