hi ppl,
i am having trouble linking my text file into a program that im writing.
I started with a basic string to test the outcome of the program which works fine. So,im now testing the program by reading in a sample file.
the text file is a sequence of letters
sorry if i been unclear...if you have any querys let me know...Code:int main() string information; information = readFile(); // have a function to read a file in. // HAVING trouble mapping the information from my text file map<string,int> strSet; /********************************/ string data("ATGCATAAAAAAAACATGATGACTAGATGACATACGATCGACTGACTGACTGACTGACTGACGAC"); this is the test string i have been working on.. /********************************/ for( string::iterator it = data.begin(); it != data.end(); ++it ) for( int i = 1;i <= 4 && i <= distance(it,data.end()); ++i ) strSet[string(it,i)]++; for( map<string,int>::iterator it2 = strSet.begin(); it2 != strSet.end(); ++it2 ) if (it2->first.size() == 4) cout << it2->second << " - " << it2->first << " matches" << endl;
any help would be appreciated as it plays an important part of my work
[/code]