Skip to content

Commit

Permalink
fixed pezy#214
Browse files Browse the repository at this point in the history
  • Loading branch information
pezy committed Apr 26, 2015
1 parent 9eee8b8 commit b08e806
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions ch03/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,7 @@ string s;
cout << s[0] << endl;
```

invalid in theory, but the compiler passes.

`s` is empty, so `s[0]` is undefined. But the compiler always define `s[0]`
with `\0`, so you can use `s[0]` in the `cout`.
Try to get the first element of the `string`. It is invalid, cause this is **undefined behavior**.

##[Exercise 3.10](ex3_10.cpp)
##Exercise 3.11
Expand Down

0 comments on commit b08e806

Please sign in to comment.