# Vector\< pair\<\> \>

**URL:** <https://root-forum.cern.ch/t/vector-pair/11896>\
**Category:** ROOT\
**Created:** [February 18, 2011, 3:38pm UTC](https://root-forum.cern.ch/t/vector-pair/11896 "2011-02-18T15:38:40Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![abhisek](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/c5a1d2/32.png) [@abhisek](https://root-forum.cern.ch/u/abhisek)\
**Post date:** [February 18, 2011, 3:38pm UTC](https://root-forum.cern.ch/t/vector-pair/11896/1 "2011-02-18T15:38:40Z")

</div>

Hi all,  
Could someone please explain why the below code is not working with root? It works perfectly with g++(just remove all // ) . I know it has to do with **CINT**. Can someone please guide me to a solution?  
Thanks in advance…

Abhisek

// macro [test.cc](http://test.cc)  
//#include \<stdio.h\>  
#include   
#include  
//using namespace std;

//int main(void) //  
void test()  
{  
vector\< pair\<int,double\> \> my\_data;

for(int i=1; i\<10; i++)  
{  
my\_data.push\_back( make\_pair( i, (double)i+2.2 ) );  
}  
//cout \<\< my\_data[1]-\>second\<\< endl;

for( vector\< pair\<int,double\> \>::iterator iter= my\_data.begin(); iter!=my\_data.end(); iter++)  
{  
cout \<\< iter-\>first \<\< " " \<\< iter-\>second \<\< endl;  
}

}

---

_[View the full topic](https://root-forum.cern.ch/t/vector-pair/11896)._
