Advertisement
PaweU

cpp

Feb 26th, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.60 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4. // albo to ^, albo std:: przed kazdym cinem, coutem, stringiem itd..
  5.  
  6. class Person
  7. {
  8.     public:  // docelowo class ma prywatne zmienne w srodku
  9.     std::string name;
  10.     std::string surname;
  11.     std::string profession;
  12.     void PrintFullName() {
  13.         std::cout << name << " " << surname << std::endl;
  14.     }
  15.     private:  // teraz znowu rzeczy prywatne
  16.     int number;
  17. };
  18.  
  19. void f() {}
  20. void f(int) {}
  21. void f(float) {}
  22.  
  23. int main(void){
  24.     Person p,r,w;
  25.     std::cin >> p.name >> p.surname >> p.profession;
  26.     p.PrintFullName();
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement