C++ examples for Data Type:string
Pointing to a String with Pointers
#include <iostream> #include <string> using namespace std; int main() //from www . j av a 2 s . c om { string s; string *ptrToString; s = "from book2s.com"; ptrToString = &s; cout << *ptrToString << endl; return 0; }