mardi 17 mars 2015

what's the object's type in Relationship between operation?


i read the c++ primer, i found a example like this:



int i = 1, j = 2, k = 3;

if(i < j < k)
return 0;


we all know the result's type of Relationship between operation is bool, so "i < j"'s result is true. when the previous result and k to calculate, the previous result's type will change to int?




Aucun commentaire:

Enregistrer un commentaire