C++ examples for Data Type:string
Editing a string literal
#include <iostream> using namespace std; namespace/*from ww w. ja v a 2 s.c o m*/ { const char* const STRING{ "This is a string" }; char* EDIT_STRING{ "Attempt to Edit" }; } int main() { cout << STRING << endl; cout << EDIT_STRING << endl; EDIT_STRING[0] = 'a'; cout << EDIT_STRING << endl; return 0; }