[Solved] trying to use my custom class constructor without new [closed]


new entity("entityName")

means “create an instance of entity in the free store and return a pointer to that instance”.
Since a pointer to an entity is not the same as an entity, you cannot initialise an entity with that value unless you have yet another constructor.

The way to do what you want is

entity cube("entityname");

And you need a good book on C++.

2

solved trying to use my custom class constructor without new [closed]