C++ Pointer to String

Description

C++ Pointer to String

#include <iostream> 

using namespace std; 

int main() //from ww w . ja  v  a  2  s .c  o m
{ 
  string s; 
  string *ptrToString; 
  
  s = "from  book2s.com"; 
  
  
  ptrToString = &s; 
  
  cout << *ptrToString << endl; 
  return 0; 
}



PreviousNext

Related