Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- // albo to ^, albo std:: przed kazdym cinem, coutem, stringiem itd..
- class Person
- {
- public: // docelowo class ma prywatne zmienne w srodku
- std::string name;
- std::string surname;
- std::string profession;
- void PrintFullName() {
- std::cout << name << " " << surname << std::endl;
- }
- private: // teraz znowu rzeczy prywatne
- int number;
- };
- void f() {}
- void f(int) {}
- void f(float) {}
- int main(void){
- Person p,r,w;
- std::cin >> p.name >> p.surname >> p.profession;
- p.PrintFullName();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement