更多关于编程语言, 数据库,算法等精品内容, 请访问 我的个人博客 huqijun.org
#include<iostream>
#include<string>
using namespace std;
int main()
{
size_t arry_size = 10;
char * p_str = new char[arry_size];
int count =0;
char temp;
while(cin.get(temp))
{
count ++;
if(count+1 > arry_size)
{
char *p_temp = new char[++arry_size];
strcpy(p_temp,p_str);
delete [] p_str;
p_str = p_temp;
}
&nbs