Putting a Pair of Chars into a Vector

Hello, I have this piece of code here
1
2
3
4
5
6
7
8
9
10
11
12
13
14
for (int i = 0; i < num_genes; i++) {
        cout << "Reading Gene Description For Gene " << i+1 << "..." << endl;
        string temp_str;
        Input >> temp_str;
        global_genes.push_back(temp_str);
        cout << global_genes[global_genes.size()-1] << endl;
        cout << "Reading Phenotypes For Gene " << i+1 << "..." << endl;
        char temp_charone, temp_chartwo;
        Input >> temp_charone;
        Input >> temp_chartwo;
        global_phenotypes.push_back(Pair_allele(temp_charone,temp_chartwo));
        cout << global_phenotypes[global_phenotypes.size()].first << endl;
        cout << global_phenotypes[global_phenotypes.size()].second << endl;
    }


and Get this error when I compile
error: invalid conversion from 'const char' to 'const char*'

Any help?
On line 8 I believe you meant char* and not char.
I changed it to that and now get the error

error: invalid conversion from 'char*' to 'char'

Any Help?
Last edited on
Bump
Problem Solved, just changed the char to a string
Topic archived. No new replies allowed.