void myfunc(char* passedArray)
{
cout << sizeof(passedArray) << endl; // prints 4
}
int main(void)
{
char charArray[] = "abcdefghiklmop";
cout << sizeof(charArray) << endl; // prints 15
myfunc(charArray);
cout << sizeof(charArray) << endl; // prints 15
}
我相信它仍然应该在该函数中打印 15 ......