Hey guys i am facing really big problem with pointer.
I made a programme.It worked first but if i recompile the same programme without
editing and run then it doesn't works.It says "Windows has stopped working";
But then suddenly after another compilation it works again..Sometimes it works and some times not.I got this problem a few days ago too with another programme associating pointer.If anyone know this pz help me.
Notice that you are passing an object by value. That means a copy constructor is called. As you did not define a copy constructor, default one is used. And your class will not work with it.
Remember rule of five/three:
If your class defines one of the following: destructor, copy/move constructor, copy/move assigment operator, it should define all of them.