How can I memory N words using only pointers[Dynamic Memory] ?
I tried something but I believe it's not well coded.
#include<iostream>
using namespace std;
int main ()
{
char **a;
int N;
cout<<"Enter the number of words = ";
cin>>N;
for(int i=0;i<N;i++)
{
cout<<"Enter word number "<<i<<" : ";
cin.get(*(a+i),....);
// where is ... is the lenght of the word ,and I don't know how to determine it.
cin.get();
}
return 0;
}
Can you please help me ?