mirror of
https://github.com/szymon-jozef/ZUT-notatki.git
synced 2026-10-28 11:10:38 +01:00
bla bla
This commit is contained in:
20
uczelnia/2_semestr/programowanie/laby/lab9/zad8.cpp
Normal file
20
uczelnia/2_semestr/programowanie/laby/lab9/zad8.cpp
Normal file
@@ -0,0 +1,20 @@
|
||||
#include <iostream>
|
||||
|
||||
class Bazowa {
|
||||
protected:
|
||||
int x;
|
||||
|
||||
public:
|
||||
Bazowa(int x) : x(x) {}
|
||||
};
|
||||
|
||||
class Pochodna : public Bazowa {
|
||||
public:
|
||||
Pochodna(int val) : Bazowa(val) {}
|
||||
void wypisz() { std::cout << x << std::endl; }
|
||||
};
|
||||
|
||||
int main() {
|
||||
Pochodna p = Pochodna(1);
|
||||
p.wypisz();
|
||||
}
|
||||
Reference in New Issue
Block a user