Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


advertisement
 

Tackling the Conundrums of Constant Expressions

There are const variables that arean't constant expressions; there are also constant expressions that don't have an overt const qualifier. Confused? Knowing the rules will help you avoid common mishaps.


advertisement
onstant expressions are tricky. Not all of them have an overt const qualifier. Furthermore, in some cases, a const-qualified variable is just a constant, but not a constant expression. These nuances aren't just bits of C++ trivia. Rather, they affect the correctness of your code and its performance. The following sections explain the rules of constant integral expressions and show how to avert common mishaps.


How do you know whether an expression is a constant expression? How do you turn a non-constant expression into a constant expression when necessary?


Learn the rules of constant integral expressions.





Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap