I have a program that has a base class 'control' and there are 2 dervied classes 'button' and 'textbox'.
How do i make a constructor in the 'button' or 'textbox' that initializes a pointer of the data type 'control' to point to the object that invokes the constructor
the code should look like this
1 2 3 4 5 6 7 8 9 10 11
class button:public control
//code for the constructor
actually i have an array of pointers of the type 'control' and as soon as any instance of a control like button or textbox is created the constructor should make an element of the array to point to the instance
the class 'control' has the data member 'tabstop' specified by the programmer. when the user presses tab key, the control having next tabstop should get highlighted (similar to the tab keypress in windows). For this i need an array that points to the instances of the controls when they are created.