Bonjour, je voulais savoir comment pouvait on comparer 2 types différents,
C'est a dire comparer un char * et un int, j'ai fait cela :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
 
int main(int argc, char * argv[]) {
  int cpt = 0;
  while(cin >> test){
        ++cpt;
        // mon test 
        if(cpt == argv[1]){
                 cout << "ok" << endl;
        }
}
L'erreur retourner est :
error: ISO C++ forbids comparison between pointer and integer

Donc je ne sais pas comment caster mon char * en int...

Merci de votre aide