I would like to ask how should I make absolutly dynamic strcuture of strings. Actualy I am using dynamic array with allocation of "MAX" values
Example:
const enum { MAX_WORDS = 20, MAX_LENGHT_OF_WORD = 50 }
...
char **words
words = ( char* ) malloc ( MAX_LENGHT_OF_WORD + 1 * sizeof( char* ));
for ( i = 0; i < MAX_WORDS; i++ ) {
words[i] = ( char* ) malloc ( MAX_LENGHT_OF_WORD + 1 *sizeof( char* ));
}
Should I do it without the constats somehow? Maybe with Linked Lists?
Thank you