Search code examples
c++typesversion

What could be a proper data type for software version in C++?


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.


Solution

  • 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?