
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Borland C++ 2.x ( with Turbo C ) - <b>& unary address operator; bitwise binary and operator</b>
[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
& Unary Address operator; Bitwise Binary AND operator
&lvalue Address of lvalue (used as unary address operator)
or
exp1 & exp2 Bitwise AND operator (used as binary AND operator)
The & operator has two different meanings, depending upon its
context.
When used as a unary operator, & returns the address of a variable or
function. This value can then be assigned to any pointer; you may
need to use a type-cast if the pointer you're assigning the address
to has a different type than lvalue. Here are two examples using &
as a unary address operator:
myptr = &i;
myfncptr = &myfunc;
When used as a binary operator, & performs a bit-by-bit AND operation
on exp1 and exp2. For example:
i = 0x0FF0;
j = 0xFF00;
k = i & j; /* k == 0x0F00 */
See Also: * ^^ | ~ &&
Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson