(10-24-2010, 09:14 PM)Reality Wrote: Thanks Disease, never knew that.
I had taken return 0; out because of the while (choice < 100) { loop, but I guess your placement lets it work.
Also, is there a way to have like double and float? Is that a class or something? Dunno them yet.
Why would you need both? If you need the precision of a double then just use that over float. The performance difference between floats and doubles is virtually nonexistent these days. Modern CPUs all have floating point units (FPUs) built in. Most FPUs don't even distinguish between float and double.
Barring performance the only difference between the two is memory usage. A float uses up 4 bytes while a double uses 8. Given that on the low end PCs have 1-2GBs of RAM, the memory usage isn't a problem for modern programmers. Especially considering your application only has a maximum of four.
Also, functions must always return the data type they are declared as. The one excepting being a void function, because that's what void represents: nothing. The main function is declared as an integer, thus it must always return an integer. You having a loop inside the function doesn't change that.
Ho, ho, ho! Well, if it isn't fat stinking billy goat Billy Boy in poison!
How art thou, thou globby bottle of cheap, stinking chip oil?
Come and get one in the yarbles, if ya have any yarbles, you eunuch jelly thou!
How art thou, thou globby bottle of cheap, stinking chip oil?
Come and get one in the yarbles, if ya have any yarbles, you eunuch jelly thou!