home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / c / 19590 < prev    next >
Encoding:
Text File  |  1993-01-12  |  808 b   |  27 lines

  1. Newsgroups: comp.lang.c
  2. Path: sparky!uunet!gatech!paladin.american.edu!howland.reston.ans.net!usc!cs.utexas.edu!uwm.edu!src.honeywell.com!tap
  3. From: tap@src.honeywell.com (Thomas A Peterson)
  4. Subject: full type declarations within cast expressions or unary expressions
  5. Message-ID: <1993Jan12.183016.13745@src.honeywell.com>
  6. Sender: news@src.honeywell.com (News interface)
  7. Nntp-Posting-Host: aristotle.src.honeywell.com
  8. Organization: Honeywell Systems & Research Center
  9. Date: Tue, 12 Jan 1993 18:30:16 GMT
  10. Lines: 15
  11.  
  12. Can someone explain to me why does C allow me to place a full type
  13. declaration within a cast expression or as shown in the following
  14. example within a sizeof unary expression?
  15.  
  16. main()
  17. {
  18.   int a;
  19.  
  20.   a = sizeof(enum colors {red, white, blue});
  21.   {
  22.     enum colors color = blue;
  23.   }
  24. }
  25.  
  26. Thanks, Tom
  27.