Hello,
I have a question,is it true that we can't use "break" statement with "if statment"?
Can "break" statement be only used with "for" ,"while" and "do while" loops?
thanks
Hello,
I have a question,is it true that we can't use "break" statement with "if statment"?
Can "break" statement be only used with "for" ,"while" and "do while" loops?
thanks
Yes, you cannot use a break statement to break out of an if statement. You can only use it with iteration statements and switch statements.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
thanks for the reply,
Can we use "if statement" inside an "if statement"?
Yes, it is called nesting. But these questions can easily be answered by the tool called Google.
Yes and the results will contain links to pages like these, with the related information on. Google is not the source of the information is it. So if nobody could be bothered answering more clearly ever then there would be no pages to link to.these questions can easily be answered by the tool called Google.
Last edited by rogster001; 11-17-2013 at 05:33 AM.
Thought for the day:FLTK: "The most fun you can have with your clothes on.""Are you sure your sanity chip is fully screwed in sir?" (Kryten)
Stroustrup:
"If I had thought of it and had some marketing sense every computer and just about any gadget would have had a little 'C++ Inside' sticker on it'"
What the hell are you talking about? My second result was:
C++ nested if statements
And I entered "if inside if" not "nested if".
was just saying.. sometimes we refer people to google, which already contains answer links to what they are looking for, but then obviously those search results are what forums posts and articles provide.
Thought for the day:FLTK: "The most fun you can have with your clothes on.""Are you sure your sanity chip is fully screwed in sir?" (Kryten)
Stroustrup:
"If I had thought of it and had some marketing sense every computer and just about any gadget would have had a little 'C++ Inside' sticker on it'"