float ausgeben - wie?



  • Hallo,
    Erstmal ich kenn mich mit c++ noch nicht soo gut aus, und hoffe das ich im richtigen Forum gelandet bin.
    Ich habe nämlich ein kleines Problem und zwar würde ich gerne eine float Variable mit TextOut ausgeben:

    case WM_PAINT:
            {
                 PAINTSTRUCT     ps;
                 HDC             hdc;
    
                 const float a= 10.5;
    
                 hdc = BeginPaint(hwnd, &ps);
                 {   
                     int i;
                     int y;
    
                     while(i <=20)
                     {      i = i+1;
                            y = y+20;
                            TextOut(hdc, 50, y, a, 4);
                     }
                 }
                 EndPaint(hwnd, &ps);
                 return 0; 
            }
    

    Ich krieg dann die Meldung:

    73 C:\Dokumente und Einstellungen\mr_Z\Desktop\cpp\Freitag, 25.November 2005\main.cpp cannot convert `const float' to `const CHAR*' for argument `4' to `BOOL TextOutA(HDC__*, int, int, const CHAR*, int)'
    

    Was muss ich jetzt machen, um eine Float Variable in Char "umzuwandeln".

    PS: Bitte nich hauen, hab noch nicht soo viel Ahnung davon. 😃

    €: Ich benutze Devcpp





  • Dankeee!
    Die Seite muss ich mir merken!


Anmelden zum Antworten