As far as your problem goes, I didn't see a question, but it appears you need help understanding how to use classes. Well, your Money class has a constructor that takes a char* and an int. In order to use the class, you must create an instance of the Money class. When creating an instance, you must supply the arguments to pass to one of the available constructors. In this case, there is only one constructor, so you must pass it a char* and an int.
In your code, you use what appear to be variables called m1, m2, m3, and m4. It looks like they are supposed to be of type Money, but you don't declare them anywhere. (In fact, you don't declare any of the variables in main().) You must declare these variables and initialize them with the appropriate constructor arguments. Here is an example:
Code:
#include <iostream>
class HelloWorld
{
public:
HelloWorld(int num) { savedNum = num; }
// Ignore this comment until you learn it but I would normally use an initialization list there.
~HelloWorld() { }
void DoYourThing() { std::cout << "Number is: " << savedNum << std::endl; }
private:
int savedNum;
};
int main()
{
// Create an instance of HelloWorld named hw1 and pass in 5 to the constructor (your code needs this).
HelloWorld hw1(5);
// Use the instance of HelloWorld represented by the variable hw1.
hw1.DoYourThing();
// Create another instance and use it.
HelloWorld hw2(7);
hw2.DoYourThing();
// Not necessary but your compiler might complain (if it does it is "wrong").
return 0;
}
There are still a few other problems with your code, but hopefully this helps answer your "question" for now.