I am working on a project which handles the Data of a Library Section having multiple classes. Interface of interest of a class here is this.
class Author
{
private:
//data members
public:
Author (string _name) ;
Author (string _name, int _books) ;
} ;
Data is present with at least the name of the author, and no. of books may come along. I cannot have a default constructor here naturally. But if create a static array like this.
Author auth_arr[100] ;
Compiler gives me error due to absence of default constructor. But this statement is invalid as well.
Author auth_arr[100] ("Jacob") ;
Is there any method by which i can create this array and call the constructor of my choice, instead of making another method?