# comparing an entered value to a char

• 10-21-2010
hawaiian_girl
comparing an entered value to a char
How do you check if a entered value is a char and then use recursion to reenter a value.
Here is my code so far. Please help. any help would be appreciated!
Thank you!

I have been messing around with this for days and can't seem to figure it out. The char ch i just added as well as the if. I have been deleting adding. Checking. Its a nightmare.

Also having pointers too =/... Again thankk you for any help.

Code:

```/* Prompts for and inputs a fraction with input verification */ void inputFraction(int *numerator, int *denominator) {                char ch;                 printf("Please enter a fraction (a/b): ");         scanf("%d/%d", *&numerator, *&denominator);                 if ((numerator || denominator) == ch)         {                 printf("Plese enter a valid fraction!");                 inputFraction(numerator, denominator);         } }```
• 10-21-2010
Elysia
```/* Prompts for and inputs a fraction with input verification */ void inputFraction(int *numerator, int *denominator) {                char ch;         char buffer[100];                 fgets(buffer, sizeof(buffer), stdin);         buffer[strlen(buffer) - 1] = '\0';                 printf("Please enter a fraction (a/b): ");         scanf("%d/%d", *&numerator, *&denominator);                 if ((numerator && denominator) == ch)         {                 printf("Plese enter a valid fraction!");                 inputFraction(numerator, denominator);         } }```