Advertisement
MeehoweCK

Untitled

May 25th, 2023
494
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.40 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. struct Struktura
  4. {
  5.     int x;
  6.     int y;
  7.     bool pf;
  8.     std::string napis;
  9. };
  10.  
  11. void wypisz(const Struktura &obiekt)
  12. {
  13.     std::cout << obiekt.x << '\n' << obiekt.y << '\n' << obiekt.pf << '\n' << obiekt.napis << std::endl;
  14. }
  15.  
  16. int main()
  17. {
  18.     Struktura obiekt;
  19.     obiekt.x = 10;
  20.     obiekt.y = 20;
  21.     obiekt.pf = true;
  22.     obiekt.napis = "jakis napis";
  23.  
  24.     wypisz(obiekt);
  25.  
  26.     return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement