Re: [algogeeks] Re: map problem

2011-08-24 Thread mohit verma
i think u guys dint get my question . what i want to do is : (1 float and 2
intergers) in a single map entry with float key value.
 i did it this way:

typedef const int twoint[2];

map mmap;

for inserting values i dint make any make_pair() function but used the
default one like this-
twoint tint;

cin>>tint[0]>>tint[1];

mmap.insert(makepair(f,tint));
but the compiler shows error. Do i need to redefine make_pair() or any other
way to store more than 2 values in map?


On Wed, Aug 24, 2011 at 10:31 PM, Nikhil Kumar wrote:

> Post your pair functions ..I'm sure you're wrong there!
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 

*MOHIT VERMA*

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Re: map problem

2011-08-24 Thread anusha
u can declare it without an initial size

typedef map mmap;

u can then insert values using cin within a for loop

for(i=0;i<5;i++)
{
  cin>>mmap[i];
}

c if this works

regards

anusha


On Aug 24, 8:46 pm, mohit verma  wrote:
> hey guys ,
> i want to store 3 values in stl map  making float as key value.
> I am doing something like this -
>   typedef const int twoint[2];
>   map mmap;
> but when i try to insert using make_pair() , compiler shows some error.
> could someone tell me how to include these 2 more values without using extra
> map?
>
> --
> 
> *MOHIT VERMA*

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: map problem

2011-08-24 Thread Nikhil Kumar
Post your pair functions ..I'm sure you're wrong there!

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Re: map problem

2011-08-24 Thread Anusha
u can declare and insert in this way

typedef map mmap;

for inserting within a for loop insert using cin

for(i=0;i>mmap[i];

}

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/algogeeks/-/GMOQ_jGWvfYJ.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.