[ s1cK @ 06.11.2007. 19:47 ] @
Uzeo sam polako da ucim C iz knjige "ANSI C" autora Brian W. Kernighan i Dennis M. Ritchie, pa sam naisao na jedan deo koji mi nije jasan. interesuje me u ovom source cod-u , cemu ovo ? ( oznacio sam deo koji mi nije jasan ) Code: #include <stdio.h> /* cont digits,white space, others */ main() { int c, i, nwhite, nother; int ndigit[10]; nwhite = nother = 0; for (i = 0; i < 10; ++i) /* Ovaj deo mi nije jasan, */ ndigit[i] = 0; /* i zbog cega je on tu ? */ while ((c = getchar()) != EOF) if (c >= '0' && c <= '9') ++ndigit[c-'0']; else if (c == ' ' || c == "\n" || c == '\t') ++nwhite; else ++nother; printf("digits ="); for (i = 0;i < 10; ++i) printf("%d", ndigit[i]); printf(", white space = %d, other = %d\n", nwhite, nother); } Hvala unapred. Pozdrav s1cK |