vendredi 22 octobre 2021

С typecasting in conditions

There is a simple example:

unsigned a = -5;
int b = 5;
if (a + b <= -1){
...
}

To which type will cast a+b? To signed or unsigned? And is it noted in C-standard or compiler will decide what to do?

Aucun commentaire:

Enregistrer un commentaire