please edit your post, select the code part and press the </> icon in the tool bar to mark it as code. (also make sure you indented the code in the IDE before copying, that’s done by pressing ctrlT on a PC or cmdT on a Mac)
—-
What’s the type you want to return ? What’s the type you actually return?
Usually it’s best to let the owner of the instance create it (allocate the memory) and hand it over as a reference to the function you want to use/operate on the instance