Null-terminated string: Difference between revisions

Content deleted Content added
No edit summary
m Fixed redirect
Line 5:
The null-termination characteristic has historically created [[computer insecurity|security problems]] related to the length of the string. If the null character is not put to the end of the string for some reason, any following non-related memory area is also 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. This problem can (and should) be prevented by appropriate error checking.
 
In the [[C plus plus|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 advanced "string" objects provided by the STL.
 
== Trivia ==