From c5fcf7179a83ef65c86c6a4a390029149e518649 Mon Sep 17 00:00:00 2001 From: Franciszek Malinka Date: Tue, 5 Oct 2021 21:49:54 +0200 Subject: Duzy commit ze smieciami --- Semestr 4/ask/lista7/zad7.cpp | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 Semestr 4/ask/lista7/zad7.cpp (limited to 'Semestr 4/ask/lista7/zad7.cpp') diff --git a/Semestr 4/ask/lista7/zad7.cpp b/Semestr 4/ask/lista7/zad7.cpp deleted file mode 100644 index 073224f..0000000 --- a/Semestr 4/ask/lista7/zad7.cpp +++ /dev/null @@ -1,19 +0,0 @@ -struct Base { - Base(int n) : data(n) {} - int data; - virtual int doit(int n) { return n - data; } -}; -struct Derived : Base { - Derived(int n) : Base(n + 1) {} - int doit(int n) { return n * data; } -}; - -int doit(Base *bp) { - return bp->doit(1); -} - -int main(int argc, char *argv[]) { - Base b = Base(10); - Derived d = Derived(20); - return doit(&b) + doit(&d); -} \ No newline at end of file -- cgit v1.2.3