C++
Given a va ...
Site Language: English
Українська
English
Русский
Programming Tests
Login
Sign Up
Programming Tests
Theory
Snippets
Papers
Landing
Android
Prices
FAQ
Cosmo Story
Terms and Conditions
Privacy Policy
Cookies Policy
Send Feedback
Given a variable
bool bValue = true;
What value will it have after applying the prefix increment operator to it?
++bValue;
true
false
The "++" operator cannot be applied to variables of the bool type.
Explanation
Quote from the c++ standard:
5.3.2 Increment and decrement
1 The operand of prefix ++ is modified by adding 1, or set to true if it is bool.
prefix-operator
unary
bool
operator-precedence
operators
Like
Login in
to like
Comment
Login in
to comment
Share
Tweet
C
++
Quiz
Login to learn C++
or
Read more about
C++ Quizzes
Follow CodeGalaxy
Mobile Beta
Send Feedback
Sign Up Now
or
Subscribe for future quizzes
Login in to like
Login in to comment