#include <IOSTREAM.H>
#include <string.h>
void func(char * str )
{
cout << "字符数组长度:" << strlen(str) << endl;
cout << "指针大小:" << sizeof(str) << endl;
}
int main()
{
char str[] = "123456789";
cout << "数组大小:" << sizeof(str) << endl;
cout << "数组长度:" << sizeof(str) / sizeof(int) << endl;
func(str);
}
我确定我弄混了,值得好好体会。