#include <iostream>
#include <string.h>
using namespace std;
int main()
{
char c[10] = "12cv56";
char ch[10] = "cv1245";
cout << "strlen(c) :" <<strlen(c) << endl;
cout << "strlen(ch) " <<strlen(ch) << endl;
cout << "sizeof(c): " <<sizeof(c) << endl;
cout << "sizeof(ch): " <<sizeof(ch) << endl;
return 0;
#include <string.h>
using namespace std;
int main()
{
char c[10] = "12cv56";
char ch[10] = "cv1245";
cout << "strlen(c) :" <<strlen(c) << endl;
cout << "strlen(ch) " <<strlen(ch) << endl;
cout << "sizeof(c): " <<sizeof(c) << endl;
cout << "sizeof(ch): " <<sizeof(ch) << endl;
return 0;
}
//输出:
strlen(c) :6
strlen(ch) :6
sizeof(c): 10
sizeof(ch): 10