an array is a collection of elements of the same type. a C type string is an array of type char where the last char is a null char.
Each element in an array can be accessed individually using the [] operator and an index which is an integer representing the location of the desired element within the array. Array indexes are zero based meaning the first element has index 0, the second element has index 1, etc.
Cstrings can be analyzed using a loop checking each element until you find the null terminating char, and then stopping. Or you can determine the length of the string using the strlen() function stopping when the index is the same value as the length.
For each char you can evaluate using a series of if/elses to see if it is an alphabetical char or you can use isalpha() to see if it is a char. Likewise you can test each char to see if it is a digit by using a series of if/elses or you can use the isdigit() function.
Reputation Points: 718
Solved Threads: 373
Nearly a Posting Maven
Offline 2,253 posts
since Jul 2005