|
@@ -4,7 +4,7 @@
|
|
|
#include <ctype.h>
|
|
|
|
|
|
int w_count = 1;
|
|
|
-int f_check;
|
|
|
+int f_check, str_len, j;
|
|
|
|
|
|
/* help message */
|
|
|
void print_help()
|
|
@@ -34,8 +34,11 @@ int main(int argc, char *argv[])
|
|
|
/* if '-f' in middle exit with help message */
|
|
|
if(w_count != 1 && !strcmp(argv[w_count], "-f"))
|
|
|
print_help();
|
|
|
+
|
|
|
+ /* length of word */
|
|
|
+ str_len = strlen(argv[w_count]);
|
|
|
/*print characters for each word */
|
|
|
- for (int j = 0; j < strlen(argv[w_count]); j += 1) {
|
|
|
+ for (j = 0; j < str_len; j += 1) {
|
|
|
/*
|
|
|
* if '-f' option is enable
|
|
|
* then print uppercase first character only (arg[i][0])
|