#include <assert.h>
#include <iostream>
#include <iomanip>
char array[10] = "012345678";
int main()
{
for (int i = 0; i < 10; ++i) {
std::cout << std::hex;
std::cout << "&array[i]=0x" << reinterpret_cast<int>(&array[i]) <<
" (array+i)=0x" << reinterpret_cast<int>(array+i) <<
" array[i]=0x" << static_cast<int>(array[i]) << '\n',
std::cout << std::dec;
}
return (0);
}
&array[i]=0x43d000 (array+i)=0x43d000 array[i]=0x30
&array[i]=0x43d001 (array+i)=0x43d001 array[i]=0x31
&array[i]=0x43d002 (array+i)=0x43d002 array[i]=0x32
&array[i]=0x43d003 (array+i)=0x43d003 array[i]=0x33
&array[i]=0x43d004 (array+i)=0x43d004 array[i]=0x34
&array[i]=0x43d005 (array+i)=0x43d005 array[i]=0x35
&array[i]=0x43d006 (array+i)=0x43d006 array[i]=0x36
&array[i]=0x43d007 (array+i)=0x43d007 array[i]=0x37
&array[i]=0x43d008 (array+i)=0x43d008 array[i]=0x38
&array[i]=0x43d009 (array+i)=0x43d009 array[i]=0x0