If I have 2 classes, one with a custom constructor, and the other with an instance of the first class. How do I create that instance with the custom constructor.
For example:
a.h
class A
{
public:
A(std::string input);
};
b.h
Class B
{
public:
A a("Greetings");
};
This wouldn't work properly, it gives the error "expected a type specifier" on the string itself, and whenever I use a member of class A in class B, it says "expression must have a class type"
I'm assuming this means I'd need to make it
A a(std::string words);
But I'm not sure where or how I would define what the string should be.