[Solved] is there an equivalent to ‘classname.this’ from java in c++?

[ad_1] Are you sure the definition is actually defining function onChar in class Game and not in class Screen? If you accidentally wrote this as the definition for onChar (which I can imagine could easily happen): void Screen::KeyListener::onChar(char c) {} then you are defining function in class Screen. [ad_2] solved is there an equivalent to … Read more

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

[ad_1] 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, … Read more