# Adding a vector of vectors to a tree

**URL:** <https://root-forum.cern.ch/t/adding-a-vector-of-vectors-to-a-tree/11345>\
**Category:** ROOT\
**Created:** [November 12, 2010, 3:40am UTC](https://root-forum.cern.ch/t/adding-a-vector-of-vectors-to-a-tree/11345 "2010-11-12T03:40:18Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![jsparger](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/j/6a8cbe/32.png) [@jsparger](https://root-forum.cern.ch/u/jsparger)\
**Post date:** [November 12, 2010, 3:40am UTC](https://root-forum.cern.ch/t/adding-a-vector-of-vectors-to-a-tree/11345/1 "2010-11-12T03:40:18Z")

</div>

Hello to the root community! This is my first post.

I know this question has been asked before, but I didn’t understand the answers I found on the forum. I would like to add a vector\<vector\> to a tree with something like the following code:

…  
vector\<vector\> vec\_of\_vecs;  
TBranch\* myBranch = myTree-\>Branch(“vector of vectors”, &vec\_of\_vecs);  
…  
myBranch-\>Fill();

but of course this fails on “myBranch-\>Fill()” at runtime, I suppose because myTree-\>Branch(…) returns a null pointer because it doesn’t know what a vector\<vector\> is;

From reading other posts I gather that I need to generate a dictionary (I don’t know what that is) so that this will work. I am using Visual Studios 2008 to do my coding. Could someone please explain in excruciating detail what the dictionary is, how and where I would generate it in my program, and where how I would use it in Visual Studios?

I’m afraid my lack of knowledge about C++ is what is preventing me from understanding the answers given in previous responses to this exact same question. I don’t understand the precompiler statements etc.

I greatly appreciate any help that anyone can give.

Thank you very much,  
–John

---

_[View the full topic](https://root-forum.cern.ch/t/adding-a-vector-of-vectors-to-a-tree/11345)._
