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

Recommended Answers

All 2 Replies

so.....whats the question 0_o?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.