Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikibooks

C++ Language/Std/Strings/CStringManipulation

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

A traditional C "string" is simply an array of char, where the end of the string data is terminated by a '\0' character. That terminating character is relied upon (but not counted) when strlen("abcde") measures that string's length to be 5. The lexicographical ordering of two C-strings is compared by strcmp(). To copy C-string data to some other char-array buffer, use strcpy() (or strcat(), which will concatenate by starting at the end of existing data). Additional information about C-string manipulation functions (includes interactive examples)