std::string

General Description

A std::string is an type in C++ used to represent a sequence of char types.

Include file

You can use the std::string class by including the string system include file with the statement

Note that is completely different.

Namespace issues

You can use the full name std::string, or say

This allows the shorter string name to work as well.

Basic Uses

A string can be assigned or compared to other strings, including literal strings inside double quotes. Here is a program which illustrates these basic uses: