forked from barbarer/ThinkCPP
-
-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
This section talks about how the index operator [] causes runtime errors. It doesn't on any of the compilers I've tested with unless you go way out of your way to make that happen.
The .at() member of string is actually defined to use bounds checking, but the text never mentions it.
Couple of choices here:
- remove the section
- switch the chapter to prefer
.at() - use examples like x[999999] to demonstrate a crash (will require rewriting a bit of the text, too since it claims that str[str.length()] causes a runtime error (it doesn't).
Metadata
Metadata
Assignees
Labels
No labels