Hi, I'm relatively new to C++ and am having a hard trouble understanding the instantiation of object and pointers to objects.
Whats the difference between these two declaration in terms of memory and usage? :
MyClass obj1;
MyClass *obj2;
And also the specific problem I am having is that I have a class which has an unsigned short array where the last space of the array changes if I do this:
MyClass obj;
obj = MyClass("123");
MyClass has two constructors one which will take an int and as default will assign it to zero and splice it in parts of 3 digits or less. And another which will take a string representation of a number and do the same... hope that makes sense!
It works well if I declare it
MyClass obj = MyClass("123123123");
but not if I do it the other way. Why?