Home > Back-end >  Don't understand why a friend function can't access to appreciate
Don't understand why a friend function can't access to appreciate

Time:11-07

#include
using namespace std;
The class Car;
The class Boat {private: int weight;
Public: Boat (int b) {weight=b; }
Friend int getTotalweigt (Car & amp; Acar, Boat & amp; Aboat); };
The class Car {private: int weight;
Public: Car (int) c {weight=c; }
Friend int getTotalweigt (Car & amp; Acar, Boat & amp; Aboat); };
Int getTotalweight (Car & amp; Acar, Boat & amp; Aboat) {
Return acar. Weight + aboat. Weight;
Cout<& lt;" Yes "& lt; Int main () {
Boat b1 (66);
The Car c1 (666); Coutcout <"Over" & lt; return 0; }
Problems as follows

CodePudding user response:

The last line of the E0077 tips, which refers to the line of the problem?

CodePudding user response:

reference 1st floor SuperDay response:
the last line of the E0077 hint, refers to the which line is the problem?

VS the inside is not shown, but thank you for your answer, I have found the mistake

CodePudding user response:

reference 1st floor SuperDay response:
the last line of the E0077 hint, refers to the which line is the problem?

I'm very sorry, excuse me the great spirit & gt; O

CodePudding user response:

refer to the second floor qq_45805535 response:
Quote: refer to 1st floor SuperDay response:
the last line of the E0077 hint, refers to the which line is the problem?

VS the inside is not shown, but thank you for your answer, I have found a mistake

Well, congratulations you, learn to vies to answer first the
  • Related