Probléme Structure
lirycs78
Messages postés
106
Statut
Membre
-
TOTO901 -
TOTO901 -
Bonjour,
Voici mon code :
typedef struct argument argument;
struct argument{
char path[100];
char option[5];
};
int main(int argc, char **argv)
{
argument *ARG;
if(argc < 3){
puts("Entrez tous les arguments !");
puts("Exemple : ./prog <path> <option>");
exit(0);
}
ARG->path[100+1] = '\0';
ARG->option[5+1] = '\0';
ARG->path = argv[1];
ARG->option = argv[2];
printf("Path : %s\r\n",ARG->path);
printf("Option : %s\r\n",ARG->option);
getchar();
return(0);
}
Le probléme c'est qu'a la compilation j'ai deux erreurs :
|36|erreur: incompatible types in assignment|
|37|erreur: incompatible types in assignment|
Donc a ces 2 lignes
ARG->path = argv[1];
ARG->option = argv[2];
et je ne comprend pas pk :s help me please
Voici mon code :
typedef struct argument argument;
struct argument{
char path[100];
char option[5];
};
int main(int argc, char **argv)
{
argument *ARG;
if(argc < 3){
puts("Entrez tous les arguments !");
puts("Exemple : ./prog <path> <option>");
exit(0);
}
ARG->path[100+1] = '\0';
ARG->option[5+1] = '\0';
ARG->path = argv[1];
ARG->option = argv[2];
printf("Path : %s\r\n",ARG->path);
printf("Option : %s\r\n",ARG->option);
getchar();
return(0);
}
Le probléme c'est qu'a la compilation j'ai deux erreurs :
|36|erreur: incompatible types in assignment|
|37|erreur: incompatible types in assignment|
Donc a ces 2 lignes
ARG->path = argv[1];
ARG->option = argv[2];
et je ne comprend pas pk :s help me please
A voir également:
- Probléme Structure
- Logiciel calcul structure bois gratuit - Télécharger - Architecture & Déco
- Structure d'un rapport de stage - Guide
- Structure url - Guide
- Trouvez l'erreur dans la structure du document et corrigez-la. - Forum Word
- Pdf structure 40 - Forum PDF