MeehoweCK

Untitled

Oct 2nd, 2020
1,030
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.45 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. // funkcja zwracająca więcej niż jedną wartość
  6.  
  7. struct Wynik
  8. {
  9.     int liczba;
  10.     string nazwa;
  11. };
  12.  
  13. Wynik funkcja()
  14. {
  15.     Wynik wynik;
  16.     wynik.liczba = 20;
  17.     wynik.nazwa = "wynik";
  18.     return wynik;
  19. }
  20.  
  21. void funkcja(int& wynik_liczba, string& wynik_nazwa)
  22. {
  23.    
  24. }
  25.  
  26. int main()
  27. {
  28.     Wynik wynik = funkcja();
  29.     cout << wynik.liczba << '\t' << wynik.nazwa << endl;
  30.     return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment