Re: enum question.
- From: CBFalconer <cbfalconer@xxxxxxxxx>
- Date: Sun, 11 Mar 2007 07:29:09 -0500
Ian Collins wrote:
CBFalconer wrote:.... snip ...
C++ doesn't care how much code it generates. Think about the run
time code needed to do the checking (it can't be done at compile
time, because the values are ints and can be the results of
expressions or function calls).
Sorry, but it is. You can't assign an int to an enum variable
without a cast in C++. There isn't any runtime checking, so you
can assign bollocks values if you go out of your way to do so.
We are talking about C, not C++.
--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net>
--
Posted via a free Usenet account from http://www.teranews.com
.
- Follow-Ups:
- Re: enum question.
- From: Ian Collins
- Re: enum question.
- From: Harald van Dijk
- Re: enum question.
- References:
- enum question.
- From: At_sea_with_C
- Re: enum question.
- From: CBFalconer
- Re: enum question.
- From: Ian Collins
- Re: enum question.
- From: CBFalconer
- Re: enum question.
- From: Ian Collins
- enum question.
- Prev by Date: Re: Rvalue of struct type
- Next by Date: Re: Installation Charge Free Cable Internet
- Previous by thread: Re: enum question.
- Next by thread: Re: enum question.
- Index(es):
Relevant Pages
|
|