Empty string: Difference between revisions

added assigning an empty string
(Added Nemerle)
(added assigning an empty string)
Line 12:
=={{header|C}}==
In C the strings are <code>char</code> pointers. A string terminates with the null char (U+0000, <code>'\0'</code>), which is not considered part of the string. Thus an empty string is <code>"\0"</code>, while a null string is a null pointer which points to nothing.
<lang C>/* toassign testan a nullempty string */
char *str = "";
/* to test a null string */
if (str) { ... }
/* to test if string is empty */
Anonymous user