bonjour à tous,
je cherche a convertir une string en char, voila mon code :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
 
AnsiString chemin_soft;
chemin_soft = GetCurrentDir();
char *path, *ptr;
/* get the current path environment */
ptr = getenv("PATH");
/* set up new path */
path = (char *) malloc(strlen(ptr)+15);
strcpy(path,"PATH=");
strcat(path,ptr);
strcat(path,";");
strcat(path,c_str(chemin_soft));
Je suis allé voir sur votre forum la rubrique "passer d'une string à un char" mais je ne comprend pourquoi il faut copier la chaine et utiliser "buffer"

Si vous pouviez m'aider, merci,
FOUED