"basic_string::_S_construct null not valid" error help!

I'm not sure why this error is showing up because I don't have a string that's NULL.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
int main(int argc, const char * argv[])
{
	string dna_or_rna = argv[1];
	string dna = argv[2];
	string rna = argv[3];
	string s;
	
	ifstream input;
	input.open(argv[2]);
	input >> s;
	input.close();
	
	if(dna_or_rna == "dna")
	{
		DNA aDNAString(s);
		ofstream output;
		output.open(argv[3]);
		output << "Your DNA string complimented and reversed is:" << endl;
		output << aDNAString.reverseString(s) << endl;
		output << "The GC content percentage in your DNA string is:" << endl;
		output << aDNAString.CG_percentage(s) << endl;
		vector<int>v = aDNAString.CpG_islands(s);
    	for(int i=0; i<v.size(); i++)
    		cout <<"The C of the CpG island is located at "<< v[i] << endl;
		output.close();
		return 0;
	}	
	
	if(dna_or_rna == "rna")
	{
		RNA aRNAString(s);
		ofstream output;
		output.open(argv[2]);
		if(aRNAString.validRNA(s) == 1)
		{
			output << "The amino acid string is: " << endl;
			output << aRNAString.getAminoAcid(s) << endl;
		}
		else
			cout << "The RNA string is not valid." << endl;
		output.close();
		return 0;
	}
	return 0;
}
Please post the complete error messages, all of them, exactly as they appear in your development environment.

Also what #include files are you using?

Did you check that argc is 4 ?
Topic archived. No new replies allowed.