// Strings (stringcpp.cpp #include #include // C++ string class using namespace std; int main() { // To compile with option -std=c++0x string str1 = {'a', 'p', 'p', 'l', 'e'}; // (8) C++11 Initializer List cout << str1 << endl; // "apple" string str2 {'o', 'r', 'a', 'n', 'g', 'e'}; // (8) C++11 Initializer List ("=" optional) cout << str2 << endl; // "orange" // Using C-string literal is more convenient // Included in string class to make initializer list syntax universal }