[Solved] What is the difference between overloading the assignment operator and any other operator?

Here are two differences: An overloaded assignment operator must be a member of the class being assigned to; it cannot be declared as a free function. Copy and move assignment operators will be implicitly declared for your class if you do not declare them yourself (subject to certain restrictions). solved What is the difference between … Read more

[Solved] What is the difference between overloading the assignment operator and any other operator?

Introduction The assignment operator is a special operator in C++ that is used to assign a value to a variable. It is different from other operators in that it can be overloaded, meaning that it can be given a new meaning or behavior. Overloading the assignment operator allows for more flexibility when assigning values to … Read more

[Solved] How to access the object of the class where “=” operator is disabled?

Hmmm Some task… Do one thing create a pointer of that class in your cpp file and assign memory to it using heap allocation. class *myfield = (class*)malloc(no_of_instances*sizeof(class)) Now use that object which is there in your header file assign myfield’s address to that object(hope that is pointer) Now it should work fine.. try and … Read more