K
kun niu
Dear all,
I've got the following code:
int main()
{
int *a[6][3];
cout<<(a[5]-a[2])<<endl;
cout<<a[5]<<" "<<a[2]<<endl;
return 0;
}
But the output is like this:
9
0xbff44854 0xbff44830
I know that 9 comes from (5-2)*3.
But why is the output here not 36 but 9?
Thanks for any attention and appreciate your answer in advance.
I've got the following code:
int main()
{
int *a[6][3];
cout<<(a[5]-a[2])<<endl;
cout<<a[5]<<" "<<a[2]<<endl;
return 0;
}
But the output is like this:
9
0xbff44854 0xbff44830
I know that 9 comes from (5-2)*3.
But why is the output here not 36 but 9?
Thanks for any attention and appreciate your answer in advance.