fork download
  1. #include <iostream>
  2.  
  3. int main(int argc, char **argv)
  4. {
  5. char a[20]="charstring";
  6. char * b;
  7. b=a;
  8. std::cout<<b<<std::endl<<"adress of a="<<&b<<std::endl;
  9. std::cout<<"adress of b="<<(int *) b<<std::endl;
  10. std::cout<<"adress of b="<< &b;
  11. return 0;
  12. }
Success #stdin #stdout 0s 4908KB
stdin
Standard input is empty
stdout
charstring
adress of a=0x7ffc52b1f1e8
adress of b=0x7ffc52b1f1f0
adress of b=0x7ffc52b1f1e8