Why are double parenthese used in C++?
Why are double parentheses used in C++
Page 1 of 13 Replies - 444 Views - Last Post: 13 April 2011 - 03:00 AM
Replies To: Why are double parentheses used in C++
#2
Re: Why are double parentheses used in C++
Posted 12 April 2011 - 10:46 PM
The question seems a bit vague. Sometimes people (myself at times) like to use extra parentheses to clarify operator precedents... Do you have an example in mind?
#3
Re: Why are double parentheses used in C++
Posted 12 April 2011 - 11:42 PM
GhostOfPerdition, on 12 April 2011 - 11:46 PM, said:
The question seems a bit vague. Sometimes people (myself at times) like to use extra parentheses to clarify operator precedents... Do you have an example in mind?
Thank you, after really looking at the operation I had a feeling that is why they were there.
Example: if ((cookies>=1)&&(cookies<=40))
I am new at C++ but understand logical operators from digital electronics class. I am looking at different ways to write the same program using operators.
#4
Re: Why are double parentheses used in C++
Posted 13 April 2011 - 03:00 AM
It's unnecessary in this case, but some people as a matter of habit wrap each boolean statement to be evaluated in its own set of parentheses for "clarity".
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote





|