+ 1
What is curly braces
Please someone should give me indebt understanding of what curly braces are how use them where to use them when proper in line of code.
7 Answers
+ 3
https://code.sololearn.com/cwPLTw2P3I9R/?ref=app
They have different uses:
1.) code inside of curly braces belongs together i.e. belongs to a scope. after all commands in the scope are executed all variables from inside the scope will get deleted. this allows you to define the same variable in different scopes without colision
2.) initialization: since c++11 (i think) you can give the variable a value directly when declaring it
+ 2
I can't help you with the details as I haven't started studying c++ yet but the curly braces are { and }
+ 2
Ah I see, well I hope somebody can come along with more help for you. Good luck. If no one responds, I will try to find out for you.
+ 1
Thank you. i know too well of that but my main point is where to be placing when necessary is all i want to have a deep understanding for.
0
Okay thanks.
0
Thank you sir.