Bonjour,
je veux faire une fonction split en c++.
cette fonction me retourne un tableau de string
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
char **split( string str, char c )
{
    int current = 0;
    char *tmp[MAXSTR];
    istringstream iss( str );
string mot;
    const char * s;
while ( getline( iss, mot, ';' ) )
{
 
        tmp[current] = mot.data();
        current++;
        //s=mot.c_str();
cout << mot << '\n';
}
return tmp;
}
le message d'erreur suivant me parait:
impossible de convertir de 'const char *' en 'char *'