Problem using 'if' statment to exclude characters in an array
In the folllowing code, I have an array of characters called 'data', and I want to scan through it and write characters to a file ONLY if they are not a digit or a space. I can't get this to happen; it still writes the digits and spaces to the file. I'm assuming that there's something simple I don't know which is preventing me from succeeding. Any help would be greatly appreciated.
Code:
//if statement to ignore numbers and spaces
if(data[pos - 1] != "0" && data[pos - 1] != "1" && data[pos - 1] != "2" && data[pos - 1] != "3" &&
data[pos - 1] != "4" && data[pos - 1] != "5" && data[pos - 1] != "6" && data[pos - 1] != "7" &&
data[pos - 1] != "8" && data[pos - 1] != "9" && data[pos - 1] != " ")
{
fprintf(coding_seq, "%c", data[pos - 1]);
//if a base was found, move on to the next one
j++;
}
Sorry about the sort of whacky indentation, somehow my formatting was lost when I pasted it