Skip to content

Instantly share code, notes, and snippets.

@jitpaul
Created May 5, 2018 19:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jitpaul/5026e58c4ed64b9da30b72cb0fc2812d to your computer and use it in GitHub Desktop.
Save jitpaul/5026e58c4ed64b9da30b72cb0fc2812d to your computer and use it in GitHub Desktop.
Constructor
#include <iostream>
using namespace std;
class Example1 {
public:
Example1() { cout << "Inside Example 1\n"; }
};
class Example2{
Example1 e1;
public:
Example2() { cout << "Inside Example 2\n"; }
};
int main() {
Example2 e2;
cin.get();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment