I have a base class name Elec, and 3 derived class.....capacitor, resistor, and series_circuits. I also used composition on class series_circuit to use capacitor and resistor object. In series circuit, i have declare an elec pointer to object.....Elec* *component. in the implementation, somewhere i wrote down component=new Elec*[10];..in another method, i write component= new Resistor(resName,resValue);....I got an error doing tht. They saying, unable to allocate an object of abstract type"REsistor" Can somebody have an idea to how to solve this issue??
davye_l 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.