#include <string.h>
#include <iostream>
using namespace std;
int main(void)
{
char*str =new char[100];
//在堆中申请100个char类型的内存
//拷贝Hello C++字符串到分配的堆中的内存中
strcpy(str, "Hello imooc");
count<<str<<endl;
//打印字符串
delete []str;
//释放内存
str ==NULL;
return 0;
}
#include <iostream>
using namespace std;
int main(void)
{
char*str =new char[100];
//在堆中申请100个char类型的内存
//拷贝Hello C++字符串到分配的堆中的内存中
strcpy(str, "Hello imooc");
count<<str<<endl;
//打印字符串
delete []str;
//释放内存
str ==NULL;
return 0;
}