This a very basic concept. But, I get confused generally. Help me.
Case 1:
For the below code:
int oneDArray[] = {1,2,3};
cout<<&oneDArray<<endl;
cout<<oneDArray<<endl;
cout<<&oneDArray+1<<endl;
cout<<oneDArray+1<<endl;
Output is :
0x28fef4
0x28fef4
0x28ff00
0x28fef8
Why is there a difference in the incremented values?
Case 2:
int arr[2][3] = {{1,2,3}, {4,5,6}};
cout<<&arr<<endl;
cout<<arr<<endl;
cout<<*arr<<endl;
cout<<&arr+1<<endl;
cout<<arr+1<<endl;
cout<<*arr+1<<endl;
Output is:
0x28fee8
0x28fee8
0x28fee8
0x28ff00
0x28fef4
0x28feec
Why is the output same for arr & *arr? (How it works internally)
Why is there a difference in the incremented values?
For your single-dimension array:
This is the translation from C language to English language:
Explanation for the output result of your case 1:
Apply my notes above to your second case, with these attentions: