I need to declare a field call "version", but am not sure what data type to use.
My "version" is something like "11.04". I am considering "double" as a good candidate.
Use two ints - one for the major version number and one for the minor one. Alternatively, use a string :) A double doesn't sound like a good candidate because a lot of numbers can't be represented exactly by doubles.
double is probably a bad idea, unless you are planning on using a Knuth-style version converging on an irrational number. What's wrong with an array of int, or a character string?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With