Petit problème d'erreur non identifiée par moi;

glock -  
fiddy Messages postés 11653 Statut Contributeur -
Bonsoir à tous !

Tout est dans le titre, j'ai une ***** erreur qui apparaît quand je compile mais pas moyen de savoir ou ça pêche ! Voici mon code :

#include <iostream>
#include <string>

using namespace std;

/*
J'écris une fonction valide qui prend une chaine en parametre, et qui
renvoie true si la chaine contient une chaine ADN, et false sinon.

La chaine est bien une chaine ADN si elle contient
uniquement les caracteres A, C, G ou T
*/
bool testadn(string adn)
{
for (unsigned int i(0); i<= adn.length; i++)
{
if (adn[i]!='A' and 'C' and 'G' and 'T')
{
return false;
}
return true;
}



<config>Linux / PRECISE PANGOLIN (Ubuntu 12.04 LTS)

1 réponse

fiddy Messages postés 11653 Statut Contributeur 1 847
 
if (adn[i]!='A' and 'C' and 'G' and 'T')
if (adn[i]!='A' && adn[i]!='C' && adn[i]!='G' && adn[i]!='T')

Ca sera mieux.
0