Надо написать программку чтобы динамическая массив постоянно увеличивался на 1 и записывался в ячейку сразу данные а у меня чего то не выходит наверное неправильно рассчитал
вот сама программка
#include <stdafx.h>
#include <string>
#include <iostream>
using namespace std;
int main()
{ cout<<"test"<<endl;
int i,j;
j=0;
string *mas,*ms;
for(i=0; i<50;i++)
{
j++;
if (j ==1) {
mas =new string [j]; mas[j-1]="0";
}
cout<<"j = "<<j<<endl;
if (j>1)
{
ms = new string [j-1];
ms=mas;
mas =new string [j];
mas=ms;
cout<<"mas ["<<j-2<<"] = "<<mas[j-2]<<endl;
mas[j-1]="privet";
//cout<<mas[j-1]<<endl;
}
}
cout<<"ppppppppppppp"<<endl;
//for (i=0; i<=j; i++)
cout<<"mas = "<<mas<<" i = "<<i<<" j = "<<j<<endl;
cout<<"end"<<endl;
return 0;
}