I'm trying to produce code that will check how many "A", "C", "G", and "T" characters a char contains. But I'm a little unsure how to go about doing this.. because as far as I know there aren't any operators like .contains() to check with.
The desired output would be something like:
"The char contains (variable amount) of letter A's"
In my code I have this right now:
DNAnt countDNAnt(char strand)
{
DNAnt DNA;
if (isupper(strand) == "A")
{
DNA.adenine++;
}
else if (isupper(strand) == "C")
{
DNA.cytosine++;
}
else if (isupper(strand) == "G")
{
DNA.guanine++;
}
else if (isupper(strand) == "T")
{
DNA.thymine++;
}
}
DNAnt is a structure that has the desired variables that I'm checking for (the A's, C's, G's and T's). And I'm trying to basically add to the amount of each whenever I find it inside of the char.
Thanks for the help!