fdunne2 wrote:
Hi,
I've been asked to write a Vector in C++. What is a Vector?
Regards,
Fergal.
a) This is off-topic for this forum. Ask on comp.lang.c++ .
b) A vector (or array) is a contiguous set of memory cells, each
of predetermined size. You define it as
double x[5] // allocate 5 cells for double-length
// floating point numbers
// they use 0-based numbering, so the
// last cell allocated is x[4]
x[3] = 7.3e6 ; // set the 4th cell to 7.3e6
--
Julian V. Noble
Professor Emeritus of Physics
jv*@lessspamformother.virginia.edu
^^^^^^^^^^^^^^^^^^
http://galileo.phys.virginia.edu/~jvn/
"God is not willing to do everything and thereby take away
our free will and that share of glory that rightfully belongs
to us." -- N. Machiavelli, "The Prince".