I have a class called MyClass
in main, I have
MyClass A; //calls the default constructor
A.date = 4;
I would like a function to do some stuff and then use one of A's constructors , the result being I have A back in main
class MyClass
{
public:
int name;
int date;
MyClass(){};
MyClass(int i)
{
name = i;
}
};
void MyFunc(MyClass &A)
{
int i = 3;
MyClass A(3);
}
Can you do this at all? Back in main, will A have date=4 and name=3? or just date=4?
Thanks!
Dave