Migrating from C to C++ (2)

fiveprogramminglang

https://www.youtube.com/watch?v=NvWTnIoQZj4

The C++ Programming Language (4th Edition) is a very good book, but understanding the concepts behind is not trivial and still is very difficult for me.

There is a short paper, Why C++ is not just an Object-Oriented Programming Language, in which he says that:

A language or technique is object-oriented if and only if it directly supports:

[1] Abstraction – providing some form of classes and objects.

[2] Inheritance – providing the ability to build new abstractions out of existing ones.

[3] Run-time polymorphism – providing some form of run-time binding.

class Usbsound_mono: public Usbsound {
public:
	Usbsound_mono();
	Usbsound_mono(char *s);
	virtual ~Usbsound_mono();
};
class Usbsound_iq: public Usbsound {
public:
	Usbsound_iq();
	Usbsound_iq(char *s);
	virtual ~Usbsound_iq();
};

Usbsound *mydevice[2]; /* I have two usb sound devices */
mydevice[0] = new Usbsound_mono{argv[1]}; /* this is IC-7410 */
mydevice[1] = new Usbsound_iq  {argv[2]}; /* this is Soft66LC4 */

This is just a starting point, I need to add many more features, such as pure virtual functions, abstract base classes, etc.