I have a question, pls help, thanks very much.

Try to write a C program which can analyze the input of the user in the following aspect.
1. vowels
2. consonants
3 digits
4 white spaces
5 others

You must use the logic of pointer to do this analysis in a function. there are some hints for you:
1. You may get the input of the user by using statement:
scanf(" %[^\n]",ling);
This statement can get the user input until he/she presses RETURN and put the characters in an array, in this example, it is called line[].

2. The prototype of the array can be like this:
void scan_line(char line[], int *pv, int *pc, int *pd, int *pw, int *po);

3. Inside the function you may use function toupper(char) to change each character you get from user to uppercase before you analyze them.

4. The output of the program will be like this:

Please enter a line of text below:
Solider ! 88

no. of vowels: 3
No. of consonants: 4
no. of digits: 2
no. of whitespace characters: 2
No. of other characters: 1

5 Years
Discussion Span
Last Post by v3ga
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.