samedi 30 mai 2020

Why doesn't compiler raise an error in the if statement? [duplicate]

Code is attached here. I got this code somewhere from the internet, and just want to clarify a doubt about the if-statement. I expected it raised an error.

#include <stdio.h> 

int main() {

    int a=10, b=10; 
    if(b=5)
        a--; 
    printf("%d, %d", a, b--);
    return 0;
}

Aucun commentaire:

Enregistrer un commentaire