Well, you're trying to compare one fix value with an array.
what you need is a function that tests if the specified char is alphanumeric
2 immediate ways:
you could test if the char is part of your collection with
Code:
char *strstr(const char *haystack, const char *needle);
but your collection aka array is wrong initialized, if I'm not confused, you have to initialize it like
Code:
{'1', '2', '3', '4', '5', '6', '7', '8', '9', '0'}
you also could write your own method which checks every array element if it is the same as the specified one in a for loop
Other approach: Since chars are ASCII and numbers are neighbours in ASCII Code, you can compare it like this
Code:
char c = '2'
if ('0' < c) {
printf("%c \n", c);
}
which ought to print out 2
EDIT:
When I take a second look at your code, i see that your for-loop probably won't work this way, what are you trying to accomplish? What is safed in test_pass?
if test_pass is an array, as i suppose, then you have to init the for head in another way. You want to start with first letter, which will be a position 0, so you init i at zero
Till when you want to check this string? To the end? than you have to continue loop until your 'i' which represents one char of your string, is the same position as the length of your string / array
for example:
Code:
char str[] = "Hello World";
for (int i = 0;i < strlen (str) ; i++) /* ++i or i++ doesn't really matter */
{
printf("%c", str[i]);
}