Home » 2012 » August

&& vs & and | vs ||… What’s the difference?

color-01 It seems like such a trivial thing to be talking about but not knowing the difference between && vs & or || vs | can make a huge difference between working code and code that only seems to work.

Let me illustrate:

        bool b = false;
        bool c = true;
        if(b & c)
            // do something

        if(b && c)
            // do something

Continue reading “&& vs & and | vs ||… What’s the difference?”