Re: Enum problem in WINCE

From: Michael Schaffner, P.E. (mschaffner_at_applieddata_NOSPAM.net)
Date: 11/17/04


Date: Wed, 17 Nov 2004 11:25:40 -0500

I am surprised this compiles at all under any compiler. The syntax seems
totally incorrect for enumeration types. What is it you are trying to
accomplish with this code? Are you sure that you don't want to use a
structure instead of an enumeration? The assignment c[0] |= a does not make
any sense since an enumeration type variables can only hold one of their
defined values, being a or b in your example.

-- 
Michael Schaffner, P.E.
Senior Software Engineer
Windows CE Technical Group
Applied Data Systems
"Alex" <alex@sysmop.com> wrote in message 
news:9076296.0411170356.7a3dd200@posting.google.com...
> Hi,
>
> I have problem with follow code under Windows CE .Net with eMbedded
> Vicual C++ 4.2, that works under Visual Studio 6 for Windows 2000:
>
> typedef enum
> {
> int a=1;
> int b=2;
> } temp;
>
> temp c[2];
> .
> .
> .
> c[0]|=a;
>
> The error I get is that |= operation is not allowed. There is no
> compilation problem for this code at Visual Studio 6 and with
> Metrowerks CodeWarrior compilers.
>
>
>
> Best Regards,
>
> Alex Volkov
> Software engineer
> Sysmop Technologies Ltd.
> 2 Hatamar str.
> 20692, Yoqneam Illit ISRAEL
> Phone: +972-04-9935088
> Fax:   +972-04-9937059 


Relevant Pages

  • Problem in compiling a C code with MSVC++6.00
    ... When I save the file as a cpp file, it compiles and runs ... int p1; ... void checkfile; ... printf("cannot allocate memory for elements!"); ...
    (comp.lang.c)
  • Re: Errors in compilation of simple programme
    ... using namespace std; ... cin>> i; ... it compiles without a problem on Visual C++ ... int main ...
    (microsoft.public.vc.language)
  • Re: Prime Numbers
    ... /*This code finally compiles as a 'c' code ... One more question....if i don't free up the memory allocated at the end ... it would appear that we are best served by an array ... prime numbers can be represented by an unsigned long int. ...
    (comp.lang.c)
  • Re: small newbie question
    ... INT MyFunction; ... It compiles, ... because you used a big sledgehammer to force it ... Remove all casts from your code, unless you really know what you are ...
    (microsoft.public.windowsce.embedded.vc)
  • Re: Errors in compilation of simple programme
    ... using namespace std; ... cin>> i; ... it compiles without a problem on Visual C++ ... int main ...
    (microsoft.public.vc.language)