Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What's the difference between != and =!?

Status
Not open for further replies.

McBugzz

Programmer
Sep 17, 2002
90
JP
I saw some C++ code that looked like that:

fullscreen =! fullscreen;

What's that =! thing? What does this statement mean?
 
It means fullscreen is equal to NOT fullscreen.
i.e. an assignment.
/JOlesen
 
Yes. It's less confusing if written like:

fullscreen = !fullscreen;
 
!= ... Not Equal To (Test condition)

Ie: if ( a != b) {}

=! ... Assignment to the not of the operand on the right.

Ie: if ( a =! b) {} .. If a = !b is assigned without error then the if statement is executed.

Rhoon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top