Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- struct struktura
- {
- int x;
- int y;
- string tekst;
- };
- ostream& operator<<(ostream& os, const struktura& obiekt)
- {
- os << obiekt.tekst << " (" << obiekt.x << ',' << obiekt.y << ')';
- return os;
- }
- int main() {
- struktura nowa;
- nowa.x = 5;
- nowa.y = 10;
- nowa.tekst = "jakis tekst";
- cout << nowa << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement