Yes, you can use both arrays and vectors in this manner. A vector acts just like an array with extras.
Be careful never to access elements that don't exist, remembering that arrays in C and C++ count from zero:
int n[4];
n[3]=5; // Last valid element
n[4]=5; // THIS MAY CRASH OR DO WEIRD THINGS
vector<int> v;
v.resize(4);
v[3]=5; // Last valid element
v[4]=5; // THIS MAY CRASH OR DO WEIRD THINGS
I am not sure as to what part of an array of pointers to struct type dont you get...its vectorized as each can be located anywhere in memory and not restricted to being sequential and have memory allocated throgh malloc calls.
It is a vector in the simplest of sense...direction and magnitude.
No i wasnt thinking of sparse memory but more on the lines of distributed memory...whose allocation may not be sequential but spread over pages that are currently in the processes address space without interleaving nulls.
This type of data structure has quite a few applications with hash table being one of them...others include scatter gather I/O and storing variable length strings like the lines of a file for sorting later...and if your doubt persists lookup the manpages of the readv and writev system calls.