Skip to content

Commit

Permalink
fix a spell problem and change the solution
Browse files Browse the repository at this point in the history
  • Loading branch information
mudongliang authored and pezy committed May 27, 2015
1 parent 6672db0 commit 5c01799
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ch05/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ This rewrite diminishes the readability of the code. The comma operator always g
But there are no meaning in this example, however, also are incomprehensible.

##Exercise 5.4
>Explain each of the following examples, and correct anyproblems you detect.
>Explain each of the following examples, and correct any problems you detect.
- (a) while (string::iterator iter != s.end()) { /* . . . */ }
- (b) while (bool status = find(word)) { /* . . . */ }
if (!status) { /* . . . */ }
Expand Down Expand Up @@ -95,9 +95,10 @@ In fact, the judge `!status` is unnecessary. If the `status=false`, we leave the
minval = ival;
occurs = 1;
}
(c) if (int ival = get_value())
(c) int val;
if (ival = get_value())
cout << "ival = " << ival << endl;
else if (!ival)
if (!ival)
cout << "ival = 0\n";
(d) if (ival == 0)
ival = get_value();
Expand Down

0 comments on commit 5c01799

Please sign in to comment.