Advertisement
Koelion

pedro

Jan 21st, 2017
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. struct nazwa
  5. {
  6. int a; // pole struktury
  7. int b; // pole struktury
  8. char c;
  9.  
  10. void Init(int a, int b, char c)
  11. {
  12. this->a = a;
  13. this->b = b;
  14. this->c = c;
  15. }
  16.  
  17. void DodajDoA(int b) // funckcja struktury
  18. {
  19. a += b;
  20. }
  21. void Wyswietl() // funkcja struktury
  22. {
  23. cout << "a: " << a << " b: " << b << " c: " << c << endl;
  24. }
  25. };
  26.  
  27.  
  28. int main()
  29. {
  30.  
  31. nazwa n; // tworzymy nasz obiekt
  32. n.Init(0, 0, 'A');
  33. n.Wyswietl();
  34.  
  35. while (true);
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement