I've been banging my head against the wall trying to figure out why this doesn't work. Isn't strs a pointer to a pointer of char? Any help would be appreciated. Thanks.
I get the following warning:Code:#include <stdio.h> #include <string.h> #define LIM 10 #define MAX 81 void print_arrs(const char **strs, int num); int main(void) { char strs[LIM][MAX]; puts("Enter a string, blank to quit"); while (cnt < LIM && (gets(strs[cnt]) && strs[cnt] != '\0')) { cnt++; puts("Enter a string, blank to quit"); } print_arrs(strs, cnt); return 0; } void print_arrs(const char **strs, int num) { int i; for (i = 0; i < num; i++) puts(strs[i]); return; }
tmp.c:33: warning: passing argument 1 of 'print_arrs' from incompatible pointer type



LinkBack URL
About LinkBacks



