Talk About Network

Google





Programming > C - C++ Learning > Re: Mapping Tem...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 3 Topic 4127 of 4400
Post > Topic >>

Re: Mapping Templates function betweeen 2 class

by "Jim Langston" <tazmaster@[EMAIL PROTECTED] > Apr 23, 2008 at 04:33 PM

yogesh wrote:
> Hi,
>
> I need to know how to solve this problem of the code ,
>
> kindly help me if any one know this
> given 2 cl***** A and B defined as follows
>     struct A { int a; }
>     struct B { int b; char c; }
>   the requirement is to efficiently write 2 map cl*****
>     1. class AMap
>    It should have member functions similar to below
>      add (const std::string name, A*)
>      A* get (const std::string name)
>      remove(const std::string name)
>     2. class BMap
>    It should have member functions similar to below
>      add (const std::string name, B*)
>      B* get (const std::string name)
>      remove(const std::string name)
>   Note that in the above add/get/remove functions, I have
> deliberately not provided the correct signatures as that is what you
> need to create.
>   Add a main routine that exercises all the above functions
>   no extra libs like glib should be used; STL may be used
>
>
> can any one guess what this

It sounds like you are to design two cl***** that each encapsulate a 
std::map.  One would encapsulate std::map<A> one std::map<B>.  If you are 
allowed to use templates, that may be a way to go.

Since this is homework, I can't give you any more help until you attempt
it 
on your own and then come back when you have problems showing code.

-- 
Jim Langston
tazmaster@[EMAIL PROTECTED]

 




 3 Posts in Topic:
Mapping Templates function betweeen 2 class
yogesh <yogeshkumark@[  2008-04-23 13:02:55 
Re: Mapping Templates function betweeen 2 class
"R. Scott Mellow&quo  2008-04-23 16:30:04 
Re: Mapping Templates function betweeen 2 class
"Jim Langston"   2008-04-23 16:33:14 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
localhost-V2008-12-19 Wed Jan 7 10:14:08 PST 2009.