203527 <+termbot> +bcc vowel.c 203529 <+termbot> -Borland C++ Version 3.1 Copyright (c) 1992 Borland International 203529 <+termbot> -vowel.c: 203529 <+termbot> -Error vowel.c 9: Type mismatch in parameter '__s' in call to 'fgets' in function main 203529 <+termbot> -Error vowel.c 9: Too few parameters in call to 'fgets' in function main 203529 <+termbot> -Error vowel.c 9: Nonportable pointer conversion in function main 203529 <+termbot> -Warning vowel.c 18: Unreachable code in function main 203529 <+termbot> -Error vowel.c 20: Compound statement missing } in function main 203531 <+termbot> -Warning vowel.c 20: Function should return a value in function main 203534 <+termbot> -*** 4 errors in Compile *** 203534 <+termbot> -*** 4 errors in Compile *** 203534 <+termbot> - 203535 <+termbot> - Available memory 4081880 203536 <+termbot> - 203537 <+termbot> -C:\MONKPERL> 203542 <@b_jonas> `type vowel.c 203542 <+termbot> +type vowel.c 203542 <+termbot> - #include 203542 <+termbot> -#include 203542 <+termbot> - main() 203542 <+termbot> - { 203543 <+termbot> - char c; 203545 <+termbot> - int i,n=0; /* n stands for no. of vowel*/ 203547 <+termbot> - clrscr(); 203548 <+termbot> - c=fgets(a[i]); 203549 <+termbot> - for(i=0;i<=a[i];i++) 203550 <+termbot> - { 203551 <+termbot> - switch(c) 203552 <+termbot> - { 203554 <+termbot> - case 'a': case 'e': case 'i': case 'o': case 'u': 203555 <+termbot> - n++; 203556 <+termbot> - break; 203557 <+termbot> - 203558 <+termbot> - getch(); 203559 <+termbot> - } 203600 <+termbot> - } 203600 <+termbot> - 203601 <+termbot> -C:\MONKPERL>

Let's fix the call to fgets. 203945 <@b_jonas> `edlin vowel.c 203945 <+termbot> +edlin vowel.c 203946 <+termbot> -End of input file 203946 <+termbot> -* 204002 <@b_jonas> 9 204005 <@b_jonas> `9 204005 <+termbot> +9 204006 <+termbot> - 9:* c=fgets(a[i]); 204006 <+termbot> - 9:* 204017 <@b_jonas> ` fgets(a, 9, stdin); 204017 <+termbot> + fgets(a, 9, stdin); 204017 <+termbot> -* 204023 <@b_jonas> `8,10p 204023 <+termbot> +8,10p 204023 <+termbot> - 8: clrscr(); 204023 <+termbot> - 9: fgets(a, 9, stdin); 204023 <+termbot> - 10:* for(i=0;i<=a[i];i++) 204023 <+termbot> -* 204030 <@b_jonas> `e 204031 <+termbot> +e 204031 <+termbot> - 204031 <+termbot> -C:\MONKPERL> 204039 <@b_jonas> `bcc vowel.c 204039 <+termbot> +bcc vowel.c 204041 <+termbot> -Borland C++ Version 3.1 Copyright (c) 1992 Borland International 204041 <+termbot> -vowel.c: 204042 <+termbot> -Warning vowel.c 18: Unreachable code in function main 204042 <+termbot> -Error vowel.c 20: Compound statement missing } in function main 204042 <+termbot> -Warning vowel.c 20: Function should return a value in function main 204042 <+termbot> -*** 1 errors in Compile *** 204042 <+termbot> - 204042 <+termbot> - Available memory 4081880 204044 <+termbot> - 204044 <+termbot> -C:\MONKPERL> 204406 <@cbstream> [ambrus] ah, that one error I got seems to be a mistake when I copied the program. I skipped a line. So what did you get? What does the program do for you? 204132 <@b_jonas> `edlin vowel.c 204132 <+termbot> +edlin vowel.c 204132 <+termbot> -End of input file 204132 <+termbot> -* 204405 <@b_jonas> `17 204406 <+termbot> +17 204406 <+termbot> - 17:* 204406 <+termbot> - 17:* 204407 <@b_jonas> ` } 204407 <+termbot> + } 204407 <+termbot> -* 204409 <@b_jonas> `e 204410 <+termbot> +e 204410 <+termbot> - 204410 <+termbot> -C:\MONKPERL> 204412 <@b_jonas> `bcc vowel.c 204412 <+termbot> +bcc vowel.c 204415 <+termbot> -Borland C++ Version 3.1 Copyright (c) 1992 Borland International 204415 <+termbot> -vowel.c: 204415 <+termbot> -Warning vowel.c 20: Function should return a value in function main 204415 <+termbot> -Turbo Link Version 5.1 Copyright (c) 1992 Borland International 204415 <+termbot> - 204415 <+termbot> - Available memory 4075304 204418 <+termbot> - 204418 <+termbot> -C:\MONKPERL> 204640 <@cbstream> [ambrus] Monk_perl: apart from the wrong condition in the for loop, I think there are at least two smaller problems: first, you never output anything, secondly, you call getch() too many times (once for each iteration in the for loop) 204645 <+termbot> -C:\MONKPERL> 204656 <@b_jonas> `edlin vowel.c 204657 <+termbot> +edlin vowel.c 204657 <+termbot> -End of input file 204657 <+termbot> -* 204704 <@b_jonas> `18d 204704 <+termbot> +18d 204704 <+termbot> -* 204724 <+termbot> -* 204815 <@b_jonas> `19i 204815 <+termbot> +19i 204815 <+termbot> - 19:* 204841 <@b_jonas> `printf("%d",n); 204841 <+termbot> +printf("%d",n); 204841 <+termbot> - 20:* 204844 <@b_jonas> ``o 204844 <+termbot> +^Z 204845 <+termbot> -* 204849 <@b_jonas> `17p 204849 <+termbot> +17p 204849 <+termbot> - 17: } 204849 <+termbot> - 18: } 204849 <+termbot> - 19: printf("%d",n); 204849 <+termbot> - 20:* } 204850 <+termbot> -* 204853 <@b_jonas> `10 204854 <+termbot> +10 204854 <+termbot> - 10:* for(i=0;i<=a[i];i++) 204854 <+termbot> - 10:* 204926 <@b_jonas> ` for (i = 0; 0 != a[i]; i++) 204926 <+termbot> + for (i = 0; 0 != a[i]; i++) 204926 <+termbot> -* 204933 <@b_jonas> `1p 204934 <+termbot> +1p 204934 <+termbot> - 1: #include 204934 <+termbot> - 2: #include 204934 <+termbot> - 3: main() 204934 <+termbot> - 4: { 204934 <+termbot> - 5: char c; 204934 <+termbot> - 6: char a[9]; 204935 <+termbot> - 7: int i,n=0; /* n stands for no. of vowel*/ 204935 <+termbot> - 8: clrscr(); 204936 <+termbot> - 9: fgets(a, 9, stdin); 204936 <+termbot> - 10: for (i = 0; 0 != a[i]; i++) 204937 <+termbot> - 11: { 204937 <+termbot> - 12: switch(c) 204938 <+termbot> - 13: { 204938 <+termbot> - 14: case 'a': case 'e': case 'i': case 'o': case 'u': 204939 <+termbot> - 15: n++; 204939 <+termbot> - 16: break; 204940 <+termbot> - 17: } 204940 <+termbot> - 18: } 204942 <+termbot> - 19: printf("%d",n); 204943 <+termbot> - 20:* } 204943 <+termbot> -* 205017 <@b_jonas> `e 205017 <+termbot> +e 205017 <+termbot> - 205018 <+termbot> -C:\MONKPERL> 205025 <@b_jonas> `bcc vowel.c 205025 <+termbot> +bcc vowel.c 205028 <+termbot> -Borland C++ Version 3.1 Copyright (c) 1992 Borland International 205028 <+termbot> -vowel.c: 205028 <+termbot> -Warning vowel.c 20: Function should return a value in function main 205028 <+termbot> -Turbo Link Version 5.1 Copyright (c) 1992 Borland International 205028 <+termbot> - 205028 <+termbot> - Available memory 4074540 205031 <+termbot> - 205031 <+termbot> -C:\MONKPERL> 205320 <@cbstream> [ambrus] right, the problem is, switch(c) doesn't make sense, since you only assign c once and in a wrong way at that time. you need to switch on something that's set to the next character each time. 205319 <@b_jonas> `edlin vowel.c 205320 <+termbot> +edlin vowel.c 205320 <+termbot> -End of input file 205320 <+termbot> -* 205352 <@b_jonas> `12 205352 <+termbot> +12 205352 <+termbot> - 12:* switch(c) 205352 <+termbot> - 12:* 205401 <@b_jonas> ` switch(a[i]) 205401 <+termbot> + switch(a[i]) 205401 <+termbot> -* 205403 <@b_jonas> `e 205403 <+termbot> +e 205403 <+termbot> - 205403 <+termbot> -C:\MONKPERL> 205406 <@b_jonas> `bcc vowel.c 205406 <+termbot> +bcc vowel.c 205408 <+termbot> -Borland C++ Version 3.1 Copyright (c) 1992 Borland International 205408 <+termbot> -vowel.c: 205408 <+termbot> -Warning vowel.c 20: Function should return a value in function main 205408 <+termbot> -Turbo Link Version 5.1 Copyright (c) 1992 Borland International 205409 <+termbot> - 205409 <+termbot> - Available memory 4074540 205411 <+termbot> - 205411 <+termbot> -C:\MONKPERL> 205417 <@b_jonas> `vowel 205418 <+termbot> +vowel 205420 <@b_jonas> `semi 205420 <+termbot> -semi 205420 <+termbot> -2 205420 <+termbot> -C:\MONKPERL> 205422 <@b_jonas> `vowel 205422 <+termbot> +vowel 205427 <@b_jonas> eieio 205431 <@b_jonas> `eieio 205432 <+termbot> -eieio 205432 <+termbot> -5 205432 <+termbot> -C:\MONKPERL> 205433 <@b_jonas> `vowel 205433 <+termbot> +vowel 205447 <@b_jonas> strmpf 205453 <@b_jonas> `strmpf 205454 <+termbot> -strmpf 205454 <+termbot> -0 205454 <+termbot> -C:\MONKPERL> 205523 <@cbstream> [ambrus] ah, after all the modifications, my version seems to work now. 205646 <@b_jonas> `type vowel.c 205646 <+termbot> +type vowel.c 205646 <+termbot> - #include 205646 <+termbot> -#include 205646 <+termbot> - main() 205646 <+termbot> - { 205647 <+termbot> - char c; 205647 <+termbot> - char a[9]; 205648 <+termbot> - int i,n=0; /* n stands for no. of vowel*/ 205648 <+termbot> - clrscr(); 205649 <+termbot> - fgets(a, 9, stdin); 205649 <+termbot> - for (i = 0; 0 != a[i]; i++) 205650 <+termbot> - { 205650 <+termbot> - switch(a[i]) 205651 <+termbot> - { 205651 <+termbot> - case 'a': case 'e': case 'i': case 'o': case 'u': 205652 <+termbot> - n++; 205652 <+termbot> - break; 205653 <+termbot> - } 205653 <+termbot> - } 205654 <+termbot> -printf("%d",n); 205654 <+termbot> - } 205655 <+termbot> - 205655 <+termbot> -C:\MONKPERL>