#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;
}