+ 1

How to use the alert function in C++. Plz send me an illustration

I wanted to use the alert function in c++. Can anyone send me the code for it?!

30th Jan 2018, 6:32 AM
Atharva Marathe
Atharva Marathe - avatar
3 Réponses
+ 4
You may use a simple message box in WinAPI on a Windows PC. Eg : #include<string> #include<windows.h> int Alert(string Prompt="", string Title="", UINT BtnLst=MB_OK) { return MessageBox(nullptr,Prompt.c_str() ,Title.c_str(),BtnLst); } int main() { Alert("Click Me!"); // the return value can be compared to // do something when OK is clicked. }
30th Jan 2018, 11:12 AM
Solo Wanderer 4315
Solo Wanderer 4315 - avatar
+ 1
It’s called message box in C MessageBox(0, "Content", "Title", MB_OK); https://msdn.microsoft.com/en-us/library/windows/desktop/ms645505(v=vs.85).aspx
30th Jan 2018, 7:47 AM
Toni Isotalo
Toni Isotalo - avatar
+ 1
Thanks
30th Jan 2018, 7:58 AM
Atharva Marathe
Atharva Marathe - avatar