Which rows contain errors when applying prefix and postix operators?

bool b(false);
++++b;    //1
b++++;    //2
b++;      //3
b--;      //4
Explanation
Error on line 2: the first operator "++" will work and will return (as postfix operator should do) rvalue, but applying operator "++" to the rvalue (both postfix or prefix) is not allowed. That's why an error arises here because of the presence of the second increment operator. Standard 5.2.6
Error on line 4: you can not use the "--" (both prefix and postfix) for variable of type bool. Standard 5.2.6

Слідкуй за CodeGalaxy

Мобільний додаток Beta

Get it on Google Play
Зворотній Зв’язок
Cosmo
Зареєструйся Зараз
або Підпишись на майбутні тести