//本文在 c++ builder 10.3 (64位) 调试通过。
//c、c++ 数组做参数传递,传递的是数组的指针
#include <iostream>
using namespace std;
void func(char s [ ] )
{
cout<<static_cast<void*>(s)<<endl;
s[3]='8';
}
int _tmain(int argc, _TCHAR* argv[])
{char a[50]="hello";
cout<<static_cast<void*>(a)<<endl;
cout<<a<<endl;
func(a);
cout<<a<<endl;
system("pause");
return 0;
}
//打印如下:
//000000000014FE20
//hello
//000000000014FE20
//hel8o