I have an object of class A.
class A[
{
int x;
string y;
float z;
....
}
Then I have an int, called "integer". How can I redefine the = operator in order to do something like
int integer;
A obj = integer;
in order to obtain something equal to the constructor call with NOT all members:
A obj(integer,",0);
This is a little naughty, but:
When run:
Is this what you're trying to do? Note that this is very naughty. class A is NOT an integer, and assigning it to an int is going to confuse people. C++ lets you do things that you probably shouldn't do, and this is one of them.