Quellcode, der nicht funzt



  • Warum funktioniert dieser code nicht...ist nur ne kleine spielerei...aber ich finde den fehler nicht...ich hab auch schon sehr viel probiert...kriege es aber nicht hin, dass die variablen hochgezählt werden..(die box klappt)

    #define STRICT
    #include<windows.h>
    
    int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,PSTR szCmdLine,int iCmdShow)
    {
        int iAntwort = 0;
        int iJa = 0;
        int iNein = 0;
        char stats[200];
    
       wsprintf(stats,   "Wählen sie Ja oder Nein (Abbrechen zum Beenden)\n"
                         "Jas: %i\nNeins: %i", iJa, iNein);
    
       while(iAntwort != IDCANCEL)
         {
           iAntwort = MessageBox(NULL,stats,"Statistik", MB_YESNOCANCEL | MB_DEFBUTTON1);
            if(IDYES == iAntwort)
            {
               iJa++;
            }
            else if(IDNO == iAntwort)
            {
               iNein++;
            }    
       }
    return 0;
    }
    

    Danke für eure hilfe

    edit: Codetags hinzugefügt.

    [ Dieser Beitrag wurde am 03.05.2003 um 19:29 Uhr von cd9000 editiert. ]



  • sprintf in die schleife rein.


Anmelden zum Antworten