#define _CRT_SECURE_NO_DEPRECATE //兼容C的标准格式
#include<iostream>
#include<stdio.h>
#include<string.h>
using namespace std;
//1.两种方式的到的初始化
//计算字符串的长度是一致的
int main()
{
	char ghost[15] = "Hello world !";
	char* str1="Hello world !"; 
	cout<<strlen(ghost)<<endl;
	cout << strlen(str1) << endl;
	system("pause");
}

注:编译时出现问题
13 函数体和C风格字符串_C++