Господа, как узнать размер массива?
Результат консоли.
apple is fruit
orange is fruit
grape is fruit
banana is fruit
UW1�VS�u������ is fruit
apple is FRUIT
orange is FRUIT
grape is FRUIT
banana is FRUIT
UW1�VS�u������ is FRUIT
Code:#include <stdio.h> #include <string.h> char* ser1(char* a[]) { char **ptr = a; while(*ptr){ printf("%s is fruit\n", *ptr); ptr++; } printf("\n\n\n"); } char* ser2(char* a[]) { for(a; *a != '\0';++a) { printf("%s is FRUIT\n", *a); } } int main() { char *fruit[] = {"apple","orange", "grape", "banana"}; ser1(fruit); ser2(fruit); }



Thanks

