Inheritance of constructors

Started by
1 comment, last by Eralp 16 years, 3 months ago
Hi, I want to inherit class B from class A and I have a constructor function which takes 1 parameter in class A. As far as I know when I create a B object than it executes the constructor functions of two of them(A and B). But I dont know how to pass a parameter to A's constructor. Thanks for ur helps.
Advertisement
Assuming C++...

struct A{    A(int x) { ... }};struct B : A{    B(int x, int y) : A(x) { ... }};
Ra
Oh, sorry forgot to mention C++.

Thanks thats what I am looking for :)

This topic is closed to new replies.

Advertisement