level 3
#include <iostream>
using namespace std;
void PrintSize(char* buffer)
{
cout << sizeof(buffer) << endl;
cout << strlen(buffer) << endl;
}
int main()
{
char buffer[10] = {'a', 'b', 'c', 'd', 'e'};
cout << sizeof(buffer) << endl;
PrintSize(buffer);
}
输出结果为10 4 5 第二个为什么为4
2016年04月20日 01点04分
1