I wrote this code to calculate the score of a student on the Greek entrance exams. When the program calculates the score and saves it in the variable moria
, I want the number to appear in a pop-up window.
#include <iostream>
#include <windows.h>
using namespace std;
int APIENTRY WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nCmdShow)
The last part, where the score is calculated and the message-box code comes up, is this:
mathks= mathk*0.7 + mathkp*0.3 ;
aodes= aode*0.7 + aodep*0.3 ;
fysks= fysk*0.7 + fyskp*0.3 ;
aeps= aep*0.7 + aepp*0.3 ;
ek8eshs= ek8esh*0.7 + ek8eshp*0.3 ;
mathgs= mathg*0.7 + mathgp*0.3 ;
gvp=(mathks+aodes+fysks+aeps+ek8eshs+mathgs)/6 ;
x=mathk*1.3 ;
y=fysk*0.7 ;
moria=(gvp*8+x+y)*100 ;
string moria2 = to_string(moria);
MessageBox(NULL, moria2, "arithmos moriwn", NULL);
To print the number which is a long, I think I have to turn it into a string first. But it still won't work, and I get the following errors:
- 'to_string' was not declared in this scope
- cannot convert 'std::string' to 'const CHAR*' for argument '2' to 'int MessageBoxA(HWND__, const CHAR, const CHAR*, UINT)'
Since I only recently started learning a few things about graphics, there might be some really dumb mistakes here, so please be understanding...