fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. char sname[20]="IITR";
  8. char* ptr=sname;
  9. cout<<ptr<<endl;
  10. cout<<sname<<endl;
  11. cout<<&sname<<endl;
  12. cout<<&ptr<<endl;
  13. cout<<*ptr<<endl;
  14. cout<<(int*)ptr<<endl;
  15. cout<<(int*)sname<<endl;
  16. return 0;
  17. }
  18.  
  19.  
Success #stdin #stdout 0s 5332KB
stdin
Standard input is empty
stdout
IITR
IITR
0x7fffec8ff5f0
0x7fffec8ff5e8
I
0x7fffec8ff5f0
0x7fffec8ff5f0