hello everybody!
I'd like to ask you an help to understand how to deal with arrays of strings. I don't know why but I've a mess in my mind..
Every time my program has to read several strings from stdin I do something like this:
Code:
char strings[ROWS][COLS];
int i;
for (i=0;i<ROWS;i++) 
{
printf("String #%d: ",i+1);gets(strings[i]);
}
althought I'd like to declare the array of strings in this way:
Code:
char * strings[ROWS];
which brings me to a buffer overflow..
Worse, every time I have to pass such an array to a function i do this:
Code:
quickSort(strings,0,ROW-1);
where the prototype of the function is for example:
Code:
void quickSort(char * str[],int lb, int ub)
This cause such a warning from the compiler:
Code:
 warning: passing argument 1 of ‘quickSort’ from incompatible pointer type
Then, I understood that I haven't clear in my mind how to deal with arrays of strings (maybe with multidimensional arrays in general) and my book (C how to program by Deitel) didn't help.
May you kindly suggest me any link (and excercises) to study well this topic?
Thanks a lot!
Bye!