What do you want to save?
Add Code snippet
New code examples
-
Other 2021-09-16 14:33:02
#include <bits/stdc++.h> use
#include <bits/stdc++.h> using namespace std; //Base class class Parent { public: int id_p; }; // Sub class inheriting from Base Class(Parent) class Child : public Parent { public: int id_c; }; //main function int main() ... Add solution -
Other 2021-09-05 14:12:03
->* operator
//we have a class struct X { void f() {} void g() {} }; typedef void (X::*pointer)(); //ok, let's take a pointer and assign f to it. pointer somePointer = &X::f; //now I want to call somePointer. But for that, I need an object X x; //now I call... Add solution -
C++ 2021-08-27 11:16:01
What is This pointer? Explain with an Example.
Every object in C++ has access to its own address through an important pointer called this pointer. The this pointer is an implicit parameter to all member functions. Therefore, inside a member function, this may be used to refer to the invoking object. ... Add solution