c++ - cin word to char array, each input word display all words.
<p>1.
Create global char array name inputData and size 100- input word
create dynamic array which had size = input word;</p>

<p>2.
add dynamic array which stock pointers to all words.input new word effect show all words. if array is too small, double array size. </p>

<p>So I now how do first array , create array and input in loop, but I don't now how add word to array instead overwrite and then show all words. Any help?
Maybe I just do not understand this task.</p>

<pre><code>#include &lt;iostream&gt;;
#include &lt;string.h&gt;;
#include &lt;stdio.h&gt;
char *inputData= new char[100];

using namespace std;

int main(){
//  cin&gt;&gt;::inputData;
//char* tablica2= new char (strlen(inputData));


cout&lt;&lt;"how many words"&lt;&lt;endl;
int input;
cin&gt;&gt;input;
int temp=0;
int len=0;
char *tab1= new char[input];
for(int i=0;i&lt;input;i++){
    cout&lt;&lt;" enter word "&lt;&lt;i+1&lt;&lt;endl;
    char* tem2= new char[20];
    cin&gt;&gt;::inputData;
    len=len+strlen(::inputData);

    cout&lt;&lt;len;
   // int temp= temp+ strlen(::inputData);
    //cout&lt;&lt;::inputData[temp];
   // *(inputData+i)=*tem;
}
</code></pre>