conversions in C++ -
I have this snippet of code:
header
Class A {Private: integer player; Public: A (int initPlayer = 0); A (Consta and;); & Amp; Operator = (Constant & amp; amp;;); ~ A (); Zero foo () const; Friend a and a Operator = (A and I, Const A and member); };
operator =
a & amp; Operator = (A and I, Const A and member) (i (member player); return i;}
and I have a line in my code:
i = * pa1;
A * Pa 1 = New A (A2); Initially I was int
How can I fix it Thank you in advance, I have an error should be non-static job
The assignment operator for the class should be a member of the member, not a friend.
A & amp; operator = (Constant A and Dasy) {it- & gt; player = member. Player); Return * This; }
If you want to convert a single square object to an integer, then assign the designated conversion function such as TOInt ().
With all your questions, it can be easily answered by reading a C + + text book. This will answer your last questions.
Comments
Post a Comment