I have two pointers to class A declared globally
A* a;
A* b;
int main(){
a = new A(...);
}
How should I invoke a copy constructor to make b as copy BY VALUE of a. class A does not have any pointers as fields.
I do have a constructor declared, but I can remove it in order to not override the default one.
Thanks
Simply call the copy constructor with new:
I gotta ask though… why not keep two static objects instead?