Are you sure about that? As I recall from some book somewhere (I'm sure everyone knows what book I'm talking about ), struct is 99% the same as class except that things are public by default, so it actually looks to me like your declaring a function called dice() that returns a diceClass.Basically what you are doing is calling the constructor for dice and you don't need to.