Array of strings in C? - index.of members/ jpg
when I use a string array contains I get "
how to write a program to count the number of members to make after vowels, and the index of the letter "i ".... back
or at least please help me with the algorithm ...
or provide an address .....
Please, we desperately need it ...
Thank you ....
Tuesday, February 2, 2010
Index.of Members/ Jpg Array Of Strings In C?
Subscribe to:
Post Comments (Atom)
Instead of "matrix channel" I think he meant "character." (If you really are talking about something that you can imagine, as parents, "see" what I can not help you as much as you want.)
ReplyDeleteC library functions declared in ctype.h string.hy could be very useful to do what you want. Suppose you want to do themselves, and do not use the library functions. Here is a code that you will some ideas, such as:
# \\ \\ Include \\ \\ \\ \\ u0026lt; stdio.h>
typedef enum (0 = false, true) bool;
# Define EOS '\\ \\ \\ \\ \\ \\ \\ \\ 0'
isVowel bool (char);
const char * find (const char *, char);
int main (int argc, char * argv []) (
char * s = "This Is My Test String", * p;
size_t i = 0, vcnt = 0, n = 0;
printf ( "\\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ nTest string:% s", s);
while (s [i] + +! EOS = n) + +;
printf ( "\\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ n = length% d", n);
for (i = 0, i \\ \\ \\ \\ \\ \\ \\ \\ u0026lt, n, i + +) (
if (isVowel ([i] == c) (
p = (char *) & s [i];
)
)
return p;
)
# If 0
The output of the program:
Test string: This Is My Test String
. Length = 22
. Number of members = 4
. Location (s) of the "i": 2 19
. Location (s) "X":
# Endif
Hello friend,
ReplyDelete1. To count the number of members,
Starting a variable counter = 0 Increase the counter for each entry can be a name or empno more.
2. To count the vowels,
With the loop and the statement to the quantity of vowels. For example, to count the vowels (May be upper or lower case) in a series of names and the index is the position of the words "i"
for (i = 0, i \\ \\ \\ \\ \\ \\ \\ \\ u0026lt, strlen (name); i + +)
(
Vowels = 0;
Select (name [i])
(
case 'a': case'A ';
Case e ': e case' ':
Case'': case 'I': index = i +1; / table name * bcoz increase from zero * /
or matter ": O caso ':
u Field u'':'' box:
Vocal + + break;
)
)