/* primer21.c - Duzina niske karaktera = * broj karaktera ne racunajuci \0 */ #include int strlen1( char [] ); int strlen2( char [] ); main() { char dd[15] = "Dobro jutro"; char dd1[15]={'D','o','b','a','r',' ','d','a','n'}; int duzina; duzina = strlen1( dd ); printf("dd = %d\n", duzina); duzina = strlen2( dd1 ); printf("dd1 = %d\n", duzina); } int strlen1( char s[] ) { int n; n = 0; while( s[n] != '\0' ) n = n + 1; return n; } int strlen2( char *t ) { int n; for( n = 0; *t != '\0' ; t++ ) n++; return n; }