hello all,
I'm kinda of new to C++, could someone tell me what is the difference between arrays and vectors??
Also I know how to declare arrays, how does one declare a vector??...many thanks...
hello all,
I'm kinda of new to C++, could someone tell me what is the difference between arrays and vectors??
Also I know how to declare arrays, how does one declare a vector??...many thanks...
a vector is generally described as a self expanding array, but that's not the only description. A vector can be anything you want it to be since it is not a keyword in C++, unless you are using an STL compliant compiler. In STL (Standard Template Libraray) there is a predefined, standardized class that declares and defines what a vector is and how it behaves. Generally the vector class does everything an array does, and has many of the things you write by hand to deal with arrays built in as class methods.
the only con of the vector is that its slow and not so good if youre going for graphically intense stuff. oh yeah... maybe a little steeper learning curve.
much steeper learning curve. Learn static arrays -> dynamic arrays -> dynamic data structures. In my opinion anyway...