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

 


Dernière réponse
Sujet : Afficher des variables en mode graphique sous Dos ?
antsite mais oui y a pas de quoi ! a charge de revanche

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
antsite mais oui y a pas de quoi ! a charge de revanche
[SDF]Poire Hey de rien  ;)
Un4GivN hey merci !!! :)
antsite 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.
 
Return Value
 
itoa returns a pointer to string.
Un4GivN J'ai un problème en C avec Turbo C 3
 
void init_mode_graphique(void)
{
  /* request autodetection */
  int gdriver = DETECT, gmode, errorcode;
 
  /* 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.

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