August 2012
Intermediate to advanced
976 pages
30h 17m
English
Many C++ programs predate the standard library and do not use the string and vector types. Moreover, many C++ programs interface to programs written in C or other languages that cannot use the C++ library. Hence, programs written in modern C++ may have to interface to code that uses arrays and/or C-style character strings. The C++ library offers facilities to make the interface easier to manage.
strings and C-Style StringsIn § 3.2.1 (p. 84) we saw that we can initialize a string from a string literal:
string s("Hello World"); // s holds Hello World
More generally, we can use a null-terminated ...
Read now
Unlock full access