Lecture overview -- Keyboard shortcut: 'u'  Previous page: Lvalues -- Keyboard shortcut: 'p'  Next page: C++ style strings -- Keyboard shortcut: 'n'  Lecture notes - all slides and notes together  slide -- Keyboard shortcut: 't'  Help page about these notes  Alphabetic index  Course home  Lecture 2 - Page 12 : 42
Notes about C++
Basic facilities
C-style strings

C++ supports both C-style strings and type String via the Library.

  • The C++ Programming Language: Page 90
 

  • C-style strings: char* or char[]

    • A pointer to the first character in an array of characters

    • Zero terminated

    • A string literal in C++ program, such as "string literal", is not of type String

    • Almost identical to string handling in C programs

Both C-style strings and objects or type string are mutable.