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

  FORUM HardWare.fr
  Programmation

  Afficher des variables en mode graphique sous Dos ?

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

Afficher des variables en mode graphique sous Dos ?

n°70748
Un4GivN
Posté le 08-11-2001 à 16:25:44  profilanswer
 

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.

mood
Publicité
Posté le 08-11-2001 à 16:25:44  profilanswer
 

n°70758
[SDF]Poire
Vive Grumly
Posté le 08-11-2001 à 16:35:49  profilanswer
 

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.


---------------
Des bons sites pour Delphi? http://forum.hardware.fr/forum2.php3?post=16838&cat=10 -- informaticien -- http://www.z0rglub.com/phpwebgallery/ -- Delphi :love:
n°70761
antsite
Je me souviens
Posté le 08-11-2001 à 16:40:47  profilanswer
 

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:

n°70764
antsite
Je me souviens
Posté le 08-11-2001 à 16:43:03  profilanswer
 

je me suis trompé : %d pas %s   ;)  
char var[255];  
sprintf(var,"%d",temp);  
outtextxy(x,y,var);

n°70768
Un4GivN
Posté le 08-11-2001 à 16:51:58  profilanswer
 

hey merci !!! :)

n°70770
[SDF]Poire
Vive Grumly
Posté le 08-11-2001 à 16:55:05  profilanswer
 

Hey de rien  ;)


---------------
Des bons sites pour Delphi? http://forum.hardware.fr/forum2.php3?post=16838&cat=10 -- informaticien -- http://www.z0rglub.com/phpwebgallery/ -- Delphi :love:
n°70771
antsite
Je me souviens
Posté le 08-11-2001 à 16:57:10  profilanswer
 

mais oui y a pas de quoi ! a charge de revanche


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

  Afficher des variables en mode graphique sous Dos ?

 

Sujets relatifs
Prob : Afficher un répertoire en C & Mettre Données dans une structureprogrammation graphique locker une surface
Borland c++ sous DOSAvoir les positions de la souris en mode graphique sous DOS...
Afficher plusieurs pages....Scan s'IP ss Ms-Dos
SCILAB > petit probleme graphique[openGL] afficher plusieurs point de vue
Plus de sujets relatifs à : Afficher des variables en mode graphique sous Dos ?


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR