New Posts  All Forums:Forum Nav:

C++ Messagebox Variable

post #1 of 2
Thread Starter 
I have a C++ messagebox and inside I want it to display a variable for the text how would I be able to do that?



Code:
// meow

#include <iostream>
#include <windows.h>
using namespace std;


int main()
{
    int Age, Weight, Height;
    cout << "MROW IM A SQUIRREL\
\
\
";
    cout << "Enter your age:";
    cin >> Age;
    cout << "Enter your height in inches:";
    cin >> Height;
    cout << "Enter your weight:";
    cin >> Weight;
    cout << "You are " << Age << " years old.\
";
    cout << "You are " << Height << " inches tall.\
";
    cout << "You weigh " << Weight << "lbs.";
    MessageBox (NULL, Weight , "MsgBox", 0);
    cin.get();
           return 0;
}
My System
(13 items)
 
  
CPUMotherboardGraphicsRAM
E7400 MSI P43 Neo3 (MS-7514) GeForce 7350 LE - 128MB 2GB 
Hard DriveOSMonitorKeyboard
Lots Windows XP 22" Samsung LCD Logitech G15 
PowerCaseMouse
400W Antec Full-Tower Logitech G7 
  hide details  
Reply
My System
(13 items)
 
  
CPUMotherboardGraphicsRAM
E7400 MSI P43 Neo3 (MS-7514) GeForce 7350 LE - 128MB 2GB 
Hard DriveOSMonitorKeyboard
Lots Windows XP 22" Samsung LCD Logitech G15 
PowerCaseMouse
400W Antec Full-Tower Logitech G7 
  hide details  
Reply
post #2 of 2
Quote:
Originally Posted by XxXxRobxXxX
I have a C++ messagebox and inside I want it to display a variable for the text how would I be able to do that?



Code:
// meow

#include <iostream>
#include <windows.h>
using namespace std;


int main()
{
    int Age, Weight, Height;
    cout << "MROW IM A SQUIRREL\
\
\
";
    cout << "Enter your age:";
    cin >> Age;
    cout << "Enter your height in inches:";
    cin >> Height;
    cout << "Enter your weight:";
    cin >> Weight;
    cout << "You are " << Age << " years old.\
";
    cout << "You are " << Height << " inches tall.\
";
    cout << "You weigh " << Weight << "lbs.";
    MessageBox (NULL, Weight , "MsgBox", 0);
    cin.get();
           return 0;
}
What are the MsgBox object attributes and methods?
Locate the approriate attribute and assign the value and expose with the appropriate method.
My System
(15 items)
 
  
CPUMotherboardGraphicsGraphics
i5 2500k Biostar TZ77XE4 6950 6950 
RAMHard DriveCoolingOS
8gb - DDR3 main: 120gb SSD 830 + 3 1tb drives Air Win7 
MonitorPowerCase
3 x DELL ST242OL  OCZ 900W Lian-Li Custom 
  hide details  
Reply
My System
(15 items)
 
  
CPUMotherboardGraphicsGraphics
i5 2500k Biostar TZ77XE4 6950 6950 
RAMHard DriveCoolingOS
8gb - DDR3 main: 120gb SSD 830 + 3 1tb drives Air Win7 
MonitorPowerCase
3 x DELL ST242OL  OCZ 900W Lian-Li Custom 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Application Programming