Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
inheritance test
//g++ 5.4.0 #include <iostream> using namespace std; class number { private: double n; public: number():n(0){} number(double _n):n(_n){} double square() { return (this->n)*(this->n); } bool isPositive() { return (n>0); } }; class positive_number : public number { private: double n; public: positive_number():n(0){} }; int main() { positive_number a; cout << a.square(); }
run
|
edit
|
history
|
help
0
Policy based smart pointer
4
find first non repeating
Set Insert Operation
Newspaper
Hangman
773. Sliding Puzzle
Polyrmophism
IndiSort
Elevator