The MASM Forum

General => The Workshop => Topic started by: Farabi on July 30, 2012, 07:04:35 PM

Title: What is ~0?
Post by: Farabi on July 30, 2012, 07:04:35 PM
What is "~0" mean on C++ programming? Is it mean reverse all of the zero bit? ~0=0FFFFFFFFh?
Title: Re: What is ~0?
Post by: qWord on July 30, 2012, 08:04:08 PM
yes
Title: Re: What is ~0?
Post by: Ghandi on July 31, 2012, 05:12:31 PM
The '~' operator is a bitwise NOT, otherwise known as "one's compliment":

http://www.cprogramming.com/tutorial/bitwise_operators.html

HR,
Ghandi