I was experimenting with char array and then I tried to run this program:
#include <iostream>
using namespace std ;
int main ( )
{
char *str = "Hello!" ;
cout << &str[0] << endl ;
cout << &str[1] << endl ;
cout << &str[2] << endl ;
cout << &str[3] << endl ;
cout << &str[4] << endl ;
return 0 ;
}
And I keep getting these outputs:
Hello!
ello!
llo!
lo!
o!
What exactly is happening here? I was expecting hex values.