Topic List | Page List: 1 |
---|---|
Topic | Anyone here familiar with C++? |
treewojima 04/12/17 9:45:35 AM #12: | you're free to omit brackets for if and else statements. however, the compiler will only execute the statement immediately following the conditional if (true) cout << "it's true" It's considered somewhat distasteful, especially because it can lead to code that either doesn't behave like you intended or is invalid: if (true) or if (true) in general, I always include brackets unless it's a simple one liner ... Copied to Clipboard! |
Topic List | Page List: 1 |