void func(char str_arg[100]){ cout << sizeof(str_arg) << endl; } int main(int argc,char* argv[]){ char str[] = "Hello"; char *p = str; cout << sizeof(str) << endl; cout << sizeof(p) << endl; func("test"); return 0; }
扫描二维码,关注牛客网
下载牛客APP,随时随地刷题