Null-terminated string: Difference between revisions

Content deleted Content added
rv v
Ktracy (talk | contribs)
No edit summary
Line 5:
In the [[C++]] [[programming language]], C strings are used in addition to another representation of character sequences, the <code>std::string</code> container found in the [[Standard Template Library]] (STL). Thus, it is important to differentiate between the traditional "C strings" and the more sophisticated "string" objects provided by the STL.
 
The null-termination characteristic has historically created [[computer insecurity|security problems]] related to the length of the string. If the null character is not addedcorrectly to the end of the stringaccounted for some reason, any following non-related memory area ismay also be processed as a part of the character sequence. This can lead to program crashes or leakage of program internal information to attackers or non-understanding users.
 
== Trivia ==