Say, I want an array of words that is of max length 20. I get the number of words to be stored from user input. What is the most memory efficient way to declare the above array?
I could do something like this, but I guess its not very memory efficient?
char wordArray[1000][20];
That is I want "1000" to varies accordingly to user's input. And I can't do this.
int main()
{
int size;
printf("Enter size: ");
scanf("%d", &size);
char wordArray[size][20];
}