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

  FORUM HardWare.fr
  Programmation

  Un bon programmeur de C SVP... strcat et char...

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

Un bon programmeur de C SVP... strcat et char...

n°77779
Un4GivN
Posté le 03-12-2001 à 20:38:37  profilanswer
 

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, "\\*." ); <--- ???

mood
Publicité
Posté le 03-12-2001 à 20:38:37  profilanswer
 

n°77781
LetoII
Le dormeur doit se réveiller
Posté le 03-12-2001 à 20:49:12  profilanswer
 

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);


Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation

  Un bon programmeur de C SVP... strcat et char...

 

Sujets relatifs
Shell UNIX : Aidez moi SVP Faire un ls -r en script shellRecuperer le code ascii d'un char*
Donnez moi vos idées de projet SVP ![c++] Un coup de main SVP pour un prog
[ Les STARS d'OPENGL et GLUT HELP SVP ] => gestion sourisPouvez vous traduire ce .bat, SVP ?
[c++] Tableau de charFaire une BOUTIQUE Online SVP
URGENT PHP : comment forcer une variable a passer en chaine de char ??Chacun de ces 4 algorithmes contient une erreur. Laquelle ? SVP !!!!!
Plus de sujets relatifs à : Un bon programmeur de C SVP... strcat et char...


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