С++ question

I want make a items generation by using a C++ structures in my game. So i need to generate random object with C++ procedure and (here is a problem) pass they name, damage, critchance or something to gdevelop object (dropped item). How to do this with minimum bugs?