Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Are parentheses (()) different than brackets in the C++ programing language?

0
Posted

Are parentheses (()) different than brackets in the C++ programing language?

0

Parentheses enclose the parameters of a function. A traditional way of saying it would be int main(void) to indicate there are no parameters — so we just use empty parentheses instead. Brackets enclose the bodies of functions and of blocks within functions where you can declare variables which are not visible outside those functions thus: int main(){ char a; … } int myfunc(char Dennis){ char a; … } The compiler knows which char a you are talking about in each case, so long as you don’t try to access the other one, which is out of scope in each function.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123