[Solved] Referencing to a pointer member in a different class


As the compiler is telling you, this line:

Note n = Note(&track.generator);

Tries to construct a Note and supply a Generator** to its constructor (since track.generator has type Generator*, &track.generator has type Generator**).

However, your Note class constructor accepts a Generator*, not a Generator**. Just do this instead (notice, that copy-initialization is unnecessary here, rather use direct-initialization):

Track track;
Note n(track.generator);

solved Referencing to a pointer member in a different class