+ 2
C++ (Vectors & Arrays) (doubles & floats)?
Why would we use arrays than vectors? Aren't vectors better to use, and is more useful? What about doubles, and floats? Why would we need floats, only accurate at 6 digits after the decimal then doubles, about 16 accurate digits after the decimal? Can someone explain?
2 Réponses
+ 1
In general I would use vectors and doubles. Arrays can be used to avoid heap allocations since they can be allocated on the stack. Floats use half the memory, so they provide a trade-off between precision and space.
0
I see, thanks.