Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- class student
- {
- int score;
- string name;
- public:
- student()
- {
- score = 5;
- name = "placeholder";
- }
- friend ostream& operator <<(ostream& out, const student& obj)
- {
- out << obj.score << endl << obj.name << "\n";
- return out;
- }
- };
- int main()
- {
- student obj1;
- cout << obj1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement