sizeof 的问题
程序代码:
#include <iostream> using namespace std; void Foo ( char str[100]); int main() { char a[100]="dfkdshkfihjf"; Foo(a); return 0; } void Foo ( char str[100]) { cout<<sizeof(str)<<endl; }为什么结果为 4 能详细解释一下哇,谢谢了
#include <iostream> using namespace std; void Foo ( char str[100]); int main() { char a[100]="dfkdshkfihjf"; Foo(a); return 0; } void Foo ( char str[100]) { cout<<sizeof(str)<<endl; }为什么结果为 4 能详细解释一下哇,谢谢了