The answer to this question is in link:
[http://stackoverflow.com/questions/4641476/using-dynamic-memory-allocation-for-arrays]
– user2071152Apr 10 '13 at 10:20
1 Answers1
0
#define NMAX 50
char* array[NMAX];
is an array of 50 character pointers.
You have to loop trough all of them and allocate memory for each one.
for( int i = 0 ; i < NMAX ; i++ )
{
array[ i ] = malloc( sizeof( char ) * 80 ) ;
}