Open woshiZS opened 4 years ago
I have written the according code, it shows 1 when cout <<sizeof(p)/sizeof(*p)<<endl;. My os is windows , IDE is visual studio 2019 . Does the word undefined in your anwser means the output depends on the compiler or what?
cout <<sizeof(p)/sizeof(*p)<<endl;
cout << sizeof(int ) << endl; int i[10],p=i; cout << (sizeof(i)/sizeof(i)); cout << endl; cout << (sizeof(p)/sizeof(p));
my result is 2!
I have written the according code, it shows 1 when
cout <<sizeof(p)/sizeof(*p)<<endl;
. My os is windows , IDE is visual studio 2019 . Does the word undefined in your anwser means the output depends on the compiler or what?