Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
3054 connectés 

 


Dernière réponse
Sujet : Un bon programmeur de C SVP... strcat et char...
LetoII char *deb;
 
char chaine[]= "C:\\Windows\\*.*";
char nomFic[]="System";
 
deb=strchr(chaine,'*');
 
path_2=(char *)malloc(deb-chaine+1+strlen(nomFic));
 
strncpy(path_2,chaine,deb-chaine);
strcat(path_2,nomFic);

Votre réponse
Nom d'utilisateur    Pour poster, vous devez être inscrit sur ce forum .... si ce n'est pas le cas, cliquez ici !
Le ton de votre message                        
                       
Votre réponse


[b][i][u][strike][spoiler][fixed][cpp][url][email][img][*]   
 
   [quote]
 

Options

 
Vous avez perdu votre mot de passe ?


Vue Rapide de la discussion
LetoII char *deb;
 
char chaine[]= "C:\\Windows\\*.*";
char nomFic[]="System";
 
deb=strchr(chaine,'*');
 
path_2=(char *)malloc(deb-chaine+1+strlen(nomFic));
 
strncpy(path_2,chaine,deb-chaine);
strcat(path_2,nomFic);
Un4GivN path_2 = "C:\\Windows\\*.*";
 
while(path_2[cpt2] != '*')
{
    cpt2++;
}
 
path_2[cpt2] = courant4->nom_fichier; ( disons que nom_fichier vaut "System" )
 
J'aimerais pouvoir ajouter "System" à la place de "*.*". Quelqu'un connait une bonne méthode simple ?
 
strcat(path_2, "\\*." ); <--- ???

Copyright © 1997-2025 Groupe LDLC (Signaler un contenu illicite / Données personnelles)