Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- struct Student
- {
- int album;
- string wydzial;
- string kierunek;
- short semestr;
- };
- ostream& operator<<(ostream& os, const Student& obiekt)
- {
- os << "Nr albumu: " << obiekt.album << ", " << obiekt.wydzial << ", kierunek " << obiekt.kierunek << ' ' << obiekt.semestr << ". semestr";
- return os;
- }
- int main()
- {
- Student student;
- student.album = 123456;
- student.wydzial = "Wydzial Informatyki";
- student.kierunek = "Informatyka";
- student.semestr = 2;
- cout << student << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment