I met a weird thing when I tried to understand the pointer tp this array
#include <iostream>
int main() {
using namespace std;
short tell[3]{1, 2, 3};
short (*pas)[3] = &tell;
cout << (*pas)[2] << endl;
cout << *pas[2] << endl;
cout << endl;
return 0;
}
I got two different values for the two outputs.
The first one is correct, which is 3.
However, for the second one, it seems it returns a random number which is different every time.
What is the difference between these two?