Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // main.cpp
- #include "head.h"
- #include "Klasa.h"
- int main()
- {
- funkcja();
- inna_funkcja();
- Klasa klasa;
- klasa.wypisz_wartosc();
- return 0;
- }
- // head.h
- void funkcja();
- void inna_funkcja();
- // funkcje.cpp
- #include <iostream>
- using namespace std;
- void funkcja()
- {
- cout << "to jest wywolanie pierwszej funkcji\n";
- }
- void inna_funkcja()
- {
- cout << "to jest wywolanie jakiejs innej funkcji\n";
- }
- // Klasa.h
- #ifndef KLASA_H
- #define KLASA_H
- class Klasa
- {
- public:
- Klasa();
- void wypisz_wartosc();
- protected:
- private:
- int wartosc;
- };
- #endif // KLASA_H
- // Klasa.cpp
- #include <iostream>
- #include "Klasa.h"
- using namespace std;
- Klasa::Klasa()
- {
- wartosc = 15;
- }
- void Klasa::wypisz_wartosc()
- {
- cout << "Wartoscia obiektu tej klasy jest " << wartosc << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment