SUMMARY
  • Strings are stored as null terminated character array.
  • Header file “string.h” contains lot of functions to work with strings.
  • A string constant is formed when we put characters in pair of double quotes.
  • For Copying one string into other assignment operator = cannot be used. Function strcpy() has to be used.
  • C-strings are handled with the help of a pointer to char (which points to array of char where the string is stored). However string variables should be declared as array of characters.
  • Function strlen() returns the length of the string (excluding the null character).
  • The function strcat() is used for concatenation of two strings.
  • Ordinary relational operators do not work correctly with strings. Special function strcmp() has to be ...

Get Object Oriented Programming with C++, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.