Topic: [Defect Report] enums: differences between C and C++


Author: fwl@aber.ac.uk (Frederick William Long)
Date: Tue, 27 Nov 2007 14:25:53 CST
Raw View
===================================== MODERATOR'S COMMENT:
 Forwarded to the Project Editor at editorial@versatilecoding.com.


===================================== END OF MODERATOR'S COMMENT
ISO/IEC 14882 Second edition, section C.1.5 [diff.dcl] contains an example:

    enum color { red, blue, green };
    color c = 1;                     // valid C, invalid C++

However, the second line is not valid C.

To be valid C, it would have to read:

    enum color c = 1;

Dave Price and Fred Long,
Department of Computer Science,
Aberystwyth University, UK.

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]