Winnie Pooh Girl
New member
ושוב שגיאה
זו הפונקציה שלי:
#define MAX_LENGTH 100
int main(int argc, char **argv) {
int i;
int size=5;
char *strs[size];
for (i=0; i<size; i++){
strs = (char*)malloc(sizeof(char)*MAX_LENGTH);
printf("Please enter string: ");
scanf("%s", strs);
}
filtering(strs, size, getInt);
return 0;
}
והוא נותן לי את הוורנינג הזה:
warning: format ‘%s’ expects argument of type ‘char *’, but argument 2 has type ‘char **’ [-Wformat]
מה אני צריכה לשנות?
תודה!
זו הפונקציה שלי:
#define MAX_LENGTH 100
int main(int argc, char **argv) {
int i;
int size=5;
char *strs[size];
for (i=0; i<size; i++){
strs = (char*)malloc(sizeof(char)*MAX_LENGTH);
printf("Please enter string: ");
scanf("%s", strs);
}
filtering(strs, size, getInt);
return 0;
}
והוא נותן לי את הוורנינג הזה:
warning: format ‘%s’ expects argument of type ‘char *’, but argument 2 has type ‘char **’ [-Wformat]
מה אני צריכה לשנות?
תודה!