Convertire un char vers mode_t en utilisant sscanf
lasmoum
Messages postés1Date d'inscriptionsamedi 7 mai 2011StatutMembreDernière intervention 1 avril 2011
-
1 avril 2011 à 04:40
cptpingu
Messages postés3837Date d'inscriptiondimanche 12 décembre 2004StatutModérateurDernière intervention28 mars 2023
-
1 avril 2011 à 10:53
bonne soirée,
j ai un problem avec la fonction sscanf quand je l'utilise avec les flag de compilation -Wall -W -Werror -ansi -pedantic.
je veux convertire une chaine de caractere a un mode_t et uid_t .....
header c 'est une structure, tou les champ de cette structure sn de type char
les erreurs afficher :
untar_it.c: In function ‘untar_it’:
untar_it.c:77:3: error: format ‘%6ho’ expects type ‘short unsigned int *’, but argument 3 has type ‘mode_t *’
untar_it.c:78:3: error: format ‘%6ho’ expects type ‘short unsigned int *’, but argument 3 has type ‘uid_t *’
untar_it.c:79:3: error: format ‘%6ho’ expects type ‘short unsigned int *’, but argument 3 has type ‘gid_t *’
untar_it.c:80:3: error: format ‘%11lo’ expects type ‘long unsigned int *’, but argument 3 has type ‘off_t *’
untar_it.c:81:3: error: format ‘%11lo’ expects type ‘long unsigned int *’, but argument 3 has type ‘time_t *’
untar_it.c:82:3: error: format ‘%6o’ expects type ‘unsigned int *’, but argument 3 has type ‘int *’
PS : sans les flag ca marche tres bien, svp aidez moi vite svp encore merci.
cptpingu
Messages postés3837Date d'inscriptiondimanche 12 décembre 2004StatutModérateurDernière intervention28 mars 2023123 1 avril 2011 à 10:53
sscanf prend une chaine de caractère en premier argument. Je ne comprends donc pas ce que tu cherches à réaliser...
________________________________________________________________________
Historique de mes créations, et quelques articles:
[ http://0217021.free.fr/portfoliohttp://0217021.free.fr/portfolio]
Merci d'utiliser Réponse acceptée si un post répond à votre question