error: invalid conversion from ‘char’ to ‘const char*’
Bonjour,
Tout mon problème est dans le titre, j'ai été sur plusieurs discussions avec le même type d'erreur mais je ne comprend pas.
Si quelqu'un peut m'expliquer.
Voici mon code :
Code:
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 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
| #include <string>
#include <fstream>
#include <iostream>
#include <vector>
using namespace std;
int main()
{
// le constructeur de ifstream permet d'ouvrir un fichier en lecture
ifstream fichier( "BB12001.tfa" );
int i=1;
vector<string> tab_seq;
vector<string> nom_seq;
vector<char> temp_seqRes;
vector<int> temp_seqLength;
if ( fichier ) // ce test échoue si le fichier n'est pas ouvert
{
string ligne; // variable contenant chaque ligne lue
string seq;
// cette boucle s'arrête dès qu'une erreur de lecture survient
while ( getline( fichier, ligne ) )
{
// afficher la ligne à l'écran
if (ligne[0]=='>')
{
//cout << i << " "<< ligne << endl;
nom_seq.push_back(ligne);
if (seq!="")
{
tab_seq.push_back(seq);
}
seq = "";
}
else
{
seq=seq+ligne;
//#cout << i << " "<< seq << endl;
}
i=i++;
}
tab_seq.push_back(seq);
}
int size_tab= tab_seq.size();
int size_tab_nom=nom_seq.size();
//cout <<"la taille du tableau est : " <<size_tab_nom <<endl;
string seq_inter;
char AA ;
for (int j=0;j<size_tab;j++)
{
//cout << "seq "<<j<<" la taille est de : "<<tab_seq[j].size()<<" " << nom_seq[j] << " \n"<<endl;
temp_seqLength.push_back(tab_seq[j].size());
seq_inter=tab_seq[j];
for (int i=0;i<tab_seq[j].size();i++)
{
AA=seq_inter[i];
tab_seq.push_back(AA);
//cout <<AA<<" ";
}
//cout <<endl;
}
cout <<tab_seq[1];
return 0;
} |
Merci,
Alaninho