#include <iostream>
#include <memory.h>
using namespace std;
/* */
void test(){
char *a = "hello";
char b[] = {'h','e','l','l','o','\0'};
char c[] = "hello";
cout<<sizeof(a)<<endl; //4
cout<<sizeof(b)<<endl; //6
cout<<sizeof(c)<<endl; //6(注意这个是6,计算大小的时候包含进去了'\0')
cout<<strlen(a)<<endl; //5
cout<<strlen(b)<<endl; //5(若不加'\0'结尾,则结果不确定)
cout<<strlen(c)<&......
阅读全文