fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. char *a = "Subodh";
  6. cout << "a pointer address : " << (void *)a << " value : " << a << endl ;
  7. char *b = ++a ;
  8. cout << "a pointer address : " << (void *)a << " value : " << a << endl ;
  9. cout << "b pointer address : " << (void *)b << " value : " << b << endl ;
  10. a = "Kamble" ;
  11. cout << "a pointer address : " << (void *)a << " value : " << a << endl ;
  12. return 0;
  13. }
Success #stdin #stdout 0s 3296KB
stdin
Standard input is empty
stdout
a pointer address : 0x80488e5 value : Subodh
a pointer address : 0x80488e6 value : ubodh
b pointer address : 0x80488e6 value : ubodh
a pointer address : 0x804890b value : Kamble