Consider the following code (I realize it's bad practice, just curious to see why it happens):

```
#include <iostream>

int main() {
    bool show = false;
    int output = 3;

    if (show = output || show)
        std::cout << output << std::endl;
    std::cout << "show: " << show << std::endl;

    output = 0;
    if (show = output || show)
        std::cout << output << std::endl;
    std::cout << "show: " << show << std::endl;

    return 0;
}

```

This prints

```
3
show: 1
0
show: 1

```

So, apparrently in the 2nd if clause, the assignment of `output`, which is `0`, does not actually happen. If I re-write the code like this:

```
#include <iostream>

int main() {
    bool show = false;
    int output = 3;

    if (show = output || show)
        std::cout << output << std::endl;
    std::cout << "show: " << show << std::endl;

    output = 0;
    if (show = output)  // no more || show
        std::cout << output << std::endl;
    std::cout << "show: " << show << std::endl;

    return 0;
}

```

It outputs, as I would expect:

```
3
show: 1
show: 0

```

Can anyone explain what is actually happening here? Why is `output` not assigned to `show` in the 2nd if clause of the 1st example? Im using Visual Studio 2017 Toolchain on Windows 10.