Mapping Templates function betweeen 2 class

Y

yogesh

Hi,

I need to know how to solve this problem of the code ,

kindly help me if any one know this

given 2 classes A and B defined as follows
struct A { int a; }
struct B { int b; char c; }
the requirement is to efficiently write 2 map classes
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


how to create this program
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top