Click here to Skip to main content
15,889,808 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
int polynom &= 0xFFFF;

Plz explain this line I am not geting.
thanks in adv.
Posted

Its a line of rubbish.
int polynom
Declares an integer called "polynom" and sets it's value to zero.
polynom &= 0xFFFF
Performs a logical AND between the current value of "polynom" and hexadecimal FFFF (sixteen bits, all '1's), and replaces the current value of "polynom" with the result.
I.e.
int polynom &= 0xFFFF;
declares in integer called "polynom" and sets it's value to zero - since 0 logically ANDed with anything gives zero by definition.
 
Share this answer
 
v3
Remove the &

This will declare polynnom as an int and set its value to 0xFFFF (65535 decimal)
 
Share this answer
 
If the polynom is a 16 bit number then you bitwise and it with 16 1's hence nothing will happen
if polynom > 16 bit then it will remove the bits >2 ^16
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900