0
Conditionals, nest question ?
Hey guys. Got another question ? What is C++ referring to when it goes on about NESTING if statements ? Does it just mean that C++ enables you to put as many if statements in the code as you would like ? Going through the if and else conditionals right now and all these curly brackets are confusing the hell out of me. Thanks for your help
2 odpowiedzi
+ 1
Not into C++ but AFAIK nesting is putting one block inside another (blocks are often wrapped in curly braces {} as in C++). In this case it would mean if block inside if block:
if (this) {
if (this too) {
if (thisCouldBeImportant) {
// do something
}
}
}
0
So, because there is 3 opening curly brackets on the If statements then there has to be 3 closing brackets on the bottom ??
What about this way.
if(this){
if(this too){
if(this as well){
}
Some people are putting just one curly bracket instead of 3 ?