I am doing some coding at the moment using C language just to develop my C skills. What I am doing is to store words in an allocated dynamic memory but having some difficulties with **pointer...
For example,
while ((ch = getchar()) != EOF)
if I type abcd efgh
, the characters, "abcd" should be stored in ptr[0][i]
and the second one, "efgh" should be stored in ptr[1][i]
and this should be done through looping.
I want to do it by initializing,
char **ptr = (char**)malloc(sizeof(char*)*n);
is this possible??
Any help would be very thankful!