ineedhelpnow
- 649
- 0
whats an array for?...whats a vector for? what do they do? what purpose do they serve?
Last edited:
ineedhelpnow said:whats an array for?...whats a vector for? who do they do? what purpose do they serve?
ZaidAlyafey said:Arrays are a collection of data. It holds a sequence of information indexed using natural numbers. Vectors are like those in mathematics. They have specialized operations like adding , scalar-multiplication and so on.
Usually we use arrays and vectors to store data that share a certain property. For example , the students in a class , a finite subset of even numbers , list of books on a library. Most of the time , the size of an array is fixed once declared. Arrays , are mostly used in graphics and gaming.