I have a civilian class and i want it to have a member variable of type Job.
i made the Job class, included it in the civilian header as such:
then i get this error before the consturctor in the cpp file:
[C++ Error] Civilian.cpp(21 ): E2279 Cannot find default constructor to initialize member 'Civilian::j'
i assume the compiler is assuming to instantiate the Job object but i do not want it too, do i have to just make a default constructor?
thanks,
ken
i made the Job class, included it in the civilian header as such:
Code:
//--methods involved in working void giveJob(Job); void advanceTask(); Job j;
[C++ Error] Civilian.cpp(21 ): E2279 Cannot find default constructor to initialize member 'Civilian::j'
i assume the compiler is assuming to instantiate the Job object but i do not want it too, do i have to just make a default constructor?
thanks,
ken
Comment