Welcome to Dream.In.Code
Getting C++ Help is Easy!

Join 136,491 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,716 people online right now. Registration is fast and FREE... Join Now!




Nested Vectors + Dynamic Allocation to the end

 
Reply to this topicStart new topic

Nested Vectors + Dynamic Allocation to the end

andrewtrapani
5 Mar, 2008 - 05:13 PM
Post #1

New D.I.C Head
*

Joined: 5 Mar, 2008
Posts: 1

I want an array of an array of a tuple of 4 doubles, so three vectors in total:

vector < vector < vector <double> > > myvector;

I am tripping over pushing new vectors onto the ends.

Sorry, what I write isn't proper syntax, it's just an arbitrary operation I want to do any simple way c++ allows me, which is why I am posting here.

I need to dynamically allocate the vectors by appending to the end of them.

I think I want to do:
CODE

myvector[end].push_back(new vector)
myvector[end][end2].push_back(one double input);

THen add 3 more doubles at [end][end2].

Then based on some event I will also need to do:
CODE

myvector.push_back(new vector);


So how do I actually do this?
thanks.

This post has been edited by jayman9: 5 Mar, 2008 - 06:40 PM
User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 12/2/08 07:40PM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month