# Call a parent's method

**URL:** <https://forum.kirupa.com/t/call-a-parents-method/286383>\
**Category:** programming\
**Created:** [April 14, 2009, 7:46pm UTC](https://forum.kirupa.com/t/call-a-parents-method/286383 "2009-04-14T19:46:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![NeoDreamer](https://avatars.discourse-cdn.com/v4/letter/n/ccd318/32.png) [@NeoDreamer](https://forum.kirupa.com/u/NeoDreamer)\
**Post date:** [April 14, 2009, 7:46pm UTC](https://forum.kirupa.com/t/call-a-parents-method/286383/1 "2009-04-14T19:46:16Z")

</div>

I have a setup where many children classes need the parent to do the same initialization before the child can do its task. From the child’s method, how do I call the parent’s similarly named method?

```php

class Parent
{
   public:
      Parent() {}
      void do() { cout << "parent does some initial stuff that all children need"; }
};

class Child : public Parent
{
   public:
      Child() {}
      void do() { cout << "I do this after parent does initialization"; }
};

```

I’ve done some Googling. One guy says to use “super”, but I got an “undelcared identifier” error because I think only Java has the super keyword. I’ve also read in another place that C++ doesn’t even support this at all because of multiple inheritance.
