Home > Back-end >  C overloaded <problem
C overloaded <problem

Time:12-15

# include & lt; Cstring>
# include & lt; iostream>
# include & lt; Cstdio>
using namespace std;

Class a {
Public:
A () {}
A (int int a, c, e, b), c (c), b (b) {

}
Private:
int c;
Int b;
}

Ostream & amp; Operator<(ostream & amp; OS, const & amp; C) {
OS & lt; Return the OS;
}

Int main () {
A, d (10, 20).
Cout & lt;
return 0;
}

CodePudding user response:

CodePudding user response:

 # include & lt; Cstring> 
# include & lt; iostream>
# include & lt; Cstdio>
using namespace std;

Class a {
Public:
A () {}
A (int int a, c, e, b), c (c), b (b) {

}
Friend ostram& Operator<(ostream & amp; , const a&);
Private:
int c;
Int b;
};

Ostream & amp; Operator<(ostream & amp; OS, const & amp; C) {
OS & lt; Return the OS;
}

Int main () {
A, d (10, 20).
Cout & lt;
return 0;
}

CodePudding user response:

The name class better left uppercase, casually,
  • Related