Null-terminated string: Difference between revisions

Content deleted Content added
made the extra note about musical meaning into a disambiguation in the start
edited in some more information
Line 1:
{{dablink|A number of [[stringed instrument]]s, including the [[viola]] and [[cello]], have a string that, when played open, produces the [[note|note C]]. This is usually referred to as the '''C string'''.}}
 
In computing, '''C strings''' are [[character string|character sequence]]s stored as one-dimensional [[character (computing)|character]] [[array]]s in the [[C programming language|C]] and [[Cterminated Pluswith Plus|C++]] programming languages. In C, they are simply called "strings," while in C++ they are called "C strings" to differentiate them froma [[Standardnull Template Library|STLcharacter]] ([[ANSI]] standard C++'\0') strings. The Cname stringsoriginates are distinguished byfrom the fact that they are terminated with aubiquitous [[nullC characterprogramming language]] ('\0').that Thisuses null-terminationthis characteristicstring hasrepresentation, historicallyand createdis securityused problems relatedelsewhere to thedistinguish lengththis ofoften-used therepresentation stringfrom others.
 
The null-termination characteristic has historically created 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.
 
In [[C Plus Plus|C++]] programming language, C strings are used in coordination with another representation of character sequences, the Standard Template Library|STL]] ([[ANSI]] standard C++) strings. Thus, it is important to differentiate between "C strings" and "strings" that are objects of the STL ''string'' class.
 
 
==See also==