1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
#include <windows.h>
#include <stdio.h>
// Déclaration des prototypes de fonctions
// Déclaration des variables globales
char szClassName[] = "Titre";
float nbVirg;
float nbVirg1 = 1.555;
float nbVirg2 = 5.4321;
char formatReel[] = "Format = %f";
char buffer[200];
// Code du programme
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) {
//MessageBox(NULL, (LPSTR) "Une Simple MessageBox", (LPSTR) szClassName, MB_ICONINFORMATION | MB_OK);
nbVirg = nbVirg1*nbVirg2;
char buffer = printf("Invalid value.The value must be between %f. and %f..Enter a new value", nbVirg1, nbVirg2);
MessageBox(NULL, &buffer , (LPSTR) szClassName, MB_ICONINFORMATION | MB_OK);
// si je met buffer au lieu de &buffer il me retourne une erreur de compilation
return 0;
} |
Partager