Why function body is delimited by braces in cpp program?

1 answer

Answer

1083531

2026-08-06 10:30

+ Follow

In C++, function bodies are delimited by braces {} to clearly define the scope of the function. This allows the compiler to identify which statements belong to the function, enabling proper organization of code and management of variables' lifetimes. Braces also facilitate the inclusion of multiple statements within a single function, enhancing code readability and structure.

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.