Vasileios Zografos wrote in news:bqbd61$ma2$1@news7.svr.pol.co.uk:
[snip]
[color=blue]
> I thought of using something like int *data = int[num_of_vertices] but
> I will not know the num_of_vertices until after the generateVals()
> function has finished, and when the function has finished I wont be
> able to get/store the values any more.
>
> I thought of using a dynamic linked list (such as the STL vector) and[/color]
STL vector or I like to call it std::vector is not a linked list.
Its a kinda "dynamic array".
[snip]
[color=blue]
> Anyways, my question is. Is there a more elegant way to do this by
> using a dynamic array? or a linked list is the only way?[/color]
[snip]
[color=blue]
> ... so if you please know something do tell me.
>[/color]
std::vector (post a fixed standard and all known implementations)
stores it elements in a contiguous array.
HTH.
Rob.
--
http://www.victim-prime.dsl.pipex.com/