EDIT ----
So I got the code to print each individual string, but I'm stuck on outputting each different string to a file (number1.txt, number2.txt etc...)
Can someone help?
You may have to use a while loop here, instead of a for loop... If I recall, you cannot manipulate the index beyond the increment that it undergoes after reach completion of the loop. If you use a while loop:
1 2 3 4 5 6
int i;
while(i<=number)
{
//statements
i++;
}
you can at least manipulate "i" from within the loop itself, which is what you are trying to do here.
We have no idea what the values of TAA, TAG, TGA, and ATG_T?? are when the line 4 is evaluated for the first time.
If the intention is to read the string and then write each found substring into different, sequentially numbered file, then one could make a function that takes a counter and string, opens file, writes string, and closes file.