Re: Strange Operator
From: Rob Audenaerde (qro_at_oce.nl)
Date: 04/01/04
- Next message: cpp_at_newbie.___: "Where to start?"
- Previous message: Richard Bos: "Re: [OT] "thx" (was: [C] whats the difference between "char" and "Char" ?)"
- Next in thread: Chris \( Val \): "Re: Strange Operator"
- Maybe reply: Chris \( Val \): "Re: Strange Operator"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 01 Apr 2004 10:11:11 +0200
On Wed, 31 Mar 2004 12:40:39 +0100, Simon Lewis
<sheepboy69uk@NOSPAMyahoo.com> wrote:
> Dear All,
>
> I have been stepping though some code, and came across the following
> operator:
>
> value >>= 1;
>
> (value is an int)
>
> It seems to be assigning 1 to value, could anyone shed some light on its
> meaning?
It is syntactically the same as:
value +=1;
which is short for something like:
value = value + 1;
so in
value >>=1;
value = value >> 1;
where >> is the right shift operator
- Next message: cpp_at_newbie.___: "Where to start?"
- Previous message: Richard Bos: "Re: [OT] "thx" (was: [C] whats the difference between "char" and "Char" ?)"
- Next in thread: Chris \( Val \): "Re: Strange Operator"
- Maybe reply: Chris \( Val \): "Re: Strange Operator"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|