Quantcast
Channel: User HolyBlackCat - Stack Overflow
Viewing all articles
Browse latest Browse all 1285

Comment by HolyBlackCat on Is writing else statement at the last mandatory in if-else ladder in C++?

$
0
0
Yes, it's legal. In general, An if-else-if ladder is not a special case, it's just a bunch of if else where the braces after else are omitted. It's easier to see if you indent the code like this: gcc.godbolt.org/z/hb8jddv9v

Viewing all articles
Browse latest Browse all 1285

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>