Nick Gammon said:
You are storing shorts (16 bits) but getting an int (32 bit) as the argument. You are just asking for compiler warnings here.
I don't know why I'm doing it either. :D Fixed... I guess this is what happens when you do an assignment the day before its due, when you're half asleep. >_> You run into bugs everywhere, you make sloppy mistakes, and you stumble upon rather crazy solutions to problems that don't even exist. XD (Oh, and then you start pulling out your hair and scratching off your eyes when the compiler doesn't obey. :P)
In any case, I realized that, because I put default arguments in my constructor, it became the default constructor. The reason is, if you tried to overload the constructor with the default, you'd get yelled at for an ambiguous overload. So Dice d1; would indeed work. >:C I'm really sorry for wasting everyone's time. D:
Oh, and about the function creation thingy, it's because you CAN'T call an empty constructor. The way the C++ naming process works is that it can read A foo() as function foo which returns an object of class A, or it might be a constructor. It defaults to the first one (probably for the backward compatibility stuff, although it is probably also because functions are much more common than constructors).
About the *_dice, I guess I'll just have to make a vector. I was attempting to dynamically create an integer array via pointers, but the data gets cleaned, so the pointer becomes null. =\ Oh well. :)
Anyway, thanks for the help. :D And I'm sorry again for wasting time, but I appreciate all your work. :D |