Victor Bazarov wrote:[color=blue]
> "Vasileios Zografos" <vzografos@bcs. org.uk> wrote...
>[color=green]
>>Can someone please tell me what this assignment does?
>>
>>
>>iType |= EB_YMIN_ZMAX;
>>[/color]
>
>
> The same as
>
> iType = iType | EB_YMIN_ZMAX;
>
> with the exception that 'iType' is only evaluated once.
>
> Victor
>
>[/color]
Trying not to sound too ignorant....
what does | do?
"Vasileios Zografos" <vzografos@bcs. org.uk> wrote...[color=blue]
> Victor Bazarov wrote:[color=green]
> > "Vasileios Zografos" <vzografos@bcs. org.uk> wrote...
> >[color=darkred]
> >>Can someone please tell me what this assignment does?
> >>
> >>
> >>iType |= EB_YMIN_ZMAX;
> >>[/color]
> >
> >
> > The same as
> >
> > iType = iType | EB_YMIN_ZMAX;
> >
> > with the exception that 'iType' is only evaluated once.
> >
> > Victor
> >
> >[/color]
>
> Trying not to sound too ignorant....
> what does | do?
>[/color]
It's what is known as "bitwise OR". Every pair of corresponding
bits in the operands is 'or'ed to produce the corresponding bit
in the result. Example:
Vasileios Zografos wrote:[color=blue]
> Victor Bazarov wrote:
>[color=green]
>> "Vasileios Zografos" <vzografos@bcs. org.uk> wrote...
>>[color=darkred]
>>> Can someone please tell me what this assignment does?
>>>
>>>
>>> iType |= EB_YMIN_ZMAX;
>>>[/color]
>>
>>
>> The same as
>>
>> iType = iType | EB_YMIN_ZMAX;
>>
>> with the exception that 'iType' is only evaluated once.
>>
>> Victor
>>
>>[/color]
>
> Trying not to sound too ignorant....
> what does | do?
>[/color]
Bitwise OR:
A B A OR B
--- --- ------
0 0 0
0 1 1
1 0 1
1 1 1
The bitwise-OR operator is often used to "set" bits.
Comment