home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / c / 18623 < prev    next >
Encoding:
Text File  |  1992-12-21  |  1.7 KB  |  40 lines

  1. Newsgroups: comp.lang.c
  2. Path: sparky!uunet!stanford.edu!nntp.Stanford.EDU!dkeisen
  3. From: dkeisen@leland.Stanford.EDU (Dave Eisen)
  4. Subject: Re: Question to test general C knowledge
  5. Message-ID: <1992Dec18.162732.15771@leland.Stanford.EDU>
  6. Sender: news@leland.Stanford.EDU (USENET News System)
  7. Organization: Sequoia Peripherals, Inc.
  8. References: <1992Dec12.111409.147@ondec.lonestar.org> <1992Dec16.231449.22903@cs.uow.edu.au> <1992Dec18.135841.14009@crd.ge.com>
  9. Date: Fri, 18 Dec 92 16:27:32 GMT
  10. Lines: 28
  11.  
  12. In article <1992Dec18.135841.14009@crd.ge.com> volpe@ausable.crd.ge.com writes:
  13. >
  14. >Actually, I prefer the more obfuscated form:
  15. >  4["this is a test"]
  16. >
  17. >And ask them what the type and value is, and WHY this expression is legal.
  18.  
  19. We all know what the type and value is (well it's if type char and
  20. has value ' ' for those who don't know), but why it is legal is
  21. a philosphical question more than anything else. The best answer
  22. I can think of is "because dmr fucked up." Yes, x[y] is always
  23. *(x + y) so it can make sense if x is a pointer an y is integral *or*
  24. vice versa, but why do this? 
  25.  
  26. I can't think of a legitimate reason why you'd want to use x[y] where 
  27. x is an integer and y a pointer. And a compiler is certainly capable
  28. of checking types before it replaces x[y] with *(x + y). Or is there
  29. a reason, other than the obvious need for fodder for Obfuscated C
  30. contests, why this construct should be in the language?
  31.  
  32.  
  33.  
  34.  
  35. -- 
  36. Dave Eisen                               Sequoia Peripherals: (415) 967-5644
  37. dkeisen@leland.Stanford.EDU              Home:                (415) 321-5154
  38.        There's something in my library to offend everybody. 
  39.           --- Washington Coalition Against Censorship
  40.