Skip to content

Missing {} #1091

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 17, 2019
Merged

Missing {} #1091

merged 2 commits into from
Jun 17, 2019

Conversation

EmilEnchev
Copy link
Contributor

@EmilEnchev EmilEnchev commented Jun 15, 2019

Difference between this...

else
cout << "There are two adjacent elements where "
<< "the second is twice the first."
<< "\n They have values of " << *(result2++);
cout << " & " << *result2 << "." << endl;

... and this:
else
{
cout << "There are two adjacent elements where "
<< "the second is twice the first."
<< "\n They have values of " << *(result2++);
cout << " & " << *result2 << "." << endl;
}

I hope you understand difference between this:
  
else
      cout << "There are two adjacent elements where "
           << "the second is twice the first."
           << "\n They have values of " << *(result2++);
      cout << " & " << *result2 << "." << endl;

... and this:
else
   {
      cout << "There are two adjacent elements where "
           << "the second is twice the first."
           << "\n They have values of " << *(result2++);
      cout << " & " << *result2 << "." << endl;
   }
@PRMerger7
Copy link
Contributor

@EmilEnchev : Thanks for your contribution! The author(s) have been notified to review your proposed change.

Simplify and clean up output statements.
@PRMerger8
Copy link
Contributor

@corob-msft : Thanks for your contribution! The author(s) have been notified to review your proposed change.

Copy link
Contributor

@colin-home colin-home left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@EmilEnchev Thanks for contributing! I'm not sure how the output statement got split in two. I fixed that up. As a matter of style, I prefer blocks for the bodies of control statements. That way, it's always safe to add another statement, and you know what part of the control flow the statement you add belongs to. We leave them out in the documentation sometimes to minimize the white space required in examples.

@colin-home colin-home merged commit 0851eae into MicrosoftDocs:master Jun 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants