...
Use the fill algorithm to assign the value '\0'
to evey element in the specified range:
Code Block | ||
---|---|---|
| ||
const size_t const max_fill = 100; std::string bs("01234567"); fill(bs.begin(), bs.begin()+std::min(max_fill, bs.length()), '\0' ); |
...
Rule | Severity | Likelihood | Remediation Cost | Priority | Level |
---|---|---|---|---|---|
BSC34-C | 3 (high) | 3 (likely) | 1 (high) | P9 | L2 |
References
Wiki Markup |
---|
\[[Seacord 05|AA. C++ References#Seacord 05]\] Chapter 2 Strings |
...
\[[ISO/IEC 14882-2003|AA. C++ References#ISO/IEC 14882-2003]\] Section 21.3.4 basic_string element access |