Search Contact information
University of Cambridge Home Department of Engineering
University of Cambridge >  Engineering Department >  computing help
next up previous
Next: Functions Up: C++ Summary Previous: Character arrays

C++ Strings

C++ offers an alternative, often easier, way of dealing with character strings. The following prints out Hello World

#include <string>
...
string s="Hello";
string t=" World";
cout << s+t << endl;
© Cambridge University Engineering Dept
Information provided by Tim Love
2006-12-08