home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / std_unix / volume.17 / text0028.txt < prev    next >
Encoding:
Internet Message Format  |  1990-01-06  |  1.4 KB

  1. From: uunet!dg-rtp.dg.com!dg-rtp!meissner (Michael Meissner)
  2.  
  3. In article <402@longway.TIC.COM> kre@cs.mu.oz.au (Robert Elz) writes:
  4.  
  5. |  In article <401@longway.TIC.COM>, gwyn@BRL.MIL quotes someone:
  6. |  > >1) my code be written in C
  7. |  > >2) the use of graphics
  8. |  > >3) that the final version be
  9. |  > >    a) UNIX-based
  10. |  > >    b) portable to ALL UNIX SYSTEMS
  11. |  
  12. |  and then says ..
  13. |  
  14. |  > Wow, taken literally this would be EXTREMELY TOUGH.
  15. |  
  16. |  No, taken literally, this would be very easy.  Written in
  17. |  C is no problem.  Unix based is no problem, portable to
  18. |  all unix systems is easy if the result is simple enough.
  19. |  
  20. |  Graphics seems to be the complication, but remember, that "literally"
  21. |  characters are graphics, so why not try submitting ...
  22. |  
  23. |      main()
  24. |      {
  25. |          printf("Hello world\n");
  26. |      }
  27. |  
  28. |  which I believe literally meets all the (stated) requirements.
  29.  
  30. You still lose.  Under ANSI C the above program is not valid, since
  31. printf is a varargs function that has no prototype in scope.  While we
  32. are at it, main should return a valid exit status.  Ok, the revised
  33. program is:
  34.  
  35.     #include <stdio.h>
  36.  
  37.     main()
  38.     {
  39.         printf("Hello world\n");
  40.         return 0;
  41.     }
  42. --
  43.  
  44. Michael Meissner, Data General.                If compiles where much
  45. Uucp:        ...!mcnc!rti!xyzzy!meissner        faster, when would we
  46. Internet:    meissner@dg-rtp.DG.COM            have time for netnews?
  47.  
  48.  
  49. Volume-Number: Volume 17, Number 33
  50.  
  51.  
  52.