fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. char s[10]="IITR";
  8. cout<<s<<endl;
  9. cout<<&(*s)<<endl;
  10. cout<<&s<<endl;
  11. cout<<(int *) s;
  12.  
  13. char str[11] = "IITRoorkee";
  14. for (int i=0; i<10; i++) {
  15. cout<<str+i<<endl;
  16. cout<<*(str+i)<<endl;
  17. }
  18. }
Success #stdin #stdout 0.01s 5288KB
stdin
Standard input is empty
stdout
IITR
IITR
0x7fffac7dacf3
0x7fffac7dacf3IITRoorkee
I
ITRoorkee
I
TRoorkee
T
Roorkee
R
oorkee
o
orkee
o
rkee
r
kee
k
ee
e
e
e