je me suis trompé : %d pas %s ;) char var[255]; sprintf(var,"%d",temp); outtextxy(x,y,var);
antsite
tu écris ta variable dans une chaîne et tu affiche la chaîne
char var[255];
sprintf(var,"%s",temp);
outtextxy(x,y,var);
voila :hello:
[SDF]Poire
Ben tu convertit ta variable en texte...
regarde l'aide de itoa
Tiens je t'la donne mais en english :D :
Syntax
#include <stdlib.h>
char *itoa(int value, char *string, int radix);
Description
Converts an integer to a string.
itoa converts value to a null-terminated string and stores the result in string. With itoa, value is an integer.
radix specifies the base to be used in converting value; it must be between 2 and 36, inclusive. If value is negative and radix is 10, the first character of string is the minus sign (-).
Note: The space allocated for string must be large enough to hold the returned string, including the terminating null character (\0). itoa can return up to 17 bytes.
/* initialize graphics and local variables */
initgraph(&gdriver, &gmode, "" );
}
Ensuite, comment je fais pour afficher des variables ??? Pour les phrases j'utilise outtextxy(x,y,"Phrase" );
Pour afficher une variables c'est comment ??? Avec printf("%d",temp); ca plante à tous les coups.