cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
Can You Go Without Brackets?
Can You Go Without Brackets?
Dec 22, 2014 at 1:02am UTC
Suixle
(4)
Question, is:
while
(
true
)
if
(2==2)cout<<42;
The
exact
same thing as:
1
2
3
4
5
6
7
while
(
true
) {
if
(2 == 2) { cout<<42; } }
Dec 22, 2014 at 1:24am UTC
giblit
(3750)
Yes. But keep in mind if there are not braces it will only include the next
line
statement.
Last edited on
Dec 22, 2014 at 1:42am UTC
Dec 22, 2014 at 1:40am UTC
Suixle
(4)
OK, Thanks, I guess that's the part that confused me!
Topic archived. No new replies allowed.