SlideShare une entreprise Scribd logo
1  sur  6
STL (Multimap) – C++

Guy and Gal in STL

               Hi, all it's really a long time that I was away from
               this all. Few days back while I was just working, I
               got a chance to implement Map/Multi-Map of
               C++(STL). And trust me I found a cute sketch with
               all innocence of the bond of love within a "Couple"
               or more suitable word that can I choose, will be
               "Pair" (means both of them are just completing
each other), off course in Multi-Map/Map of STL.



Here, I can bet you will realize my words are not just words but
it's just the voice of your heart.



For the shake of trust you can execute the code snippet.


You can find the technical definition of the terms all over the
internet and Off-course I will not waste my time for that. I think
let's change our angle of position and have a look, you will find the
imprints of complete love. I don't know you had ever loved anyone
or not but yes, if you have any practical experience then you can
visualize the portraits more clearly


Okee, so lets have a short story about a pretty gal and a guy
(ohh           , you can imagine this as your friend       ).




Let’s change a Bit                                              Page 1
STL (Multimap) – C++

In my case, the gal is so pretty that the guy never ever wishes to
see her nervous, sad or tense face. As;
std::string pretty_gal = "dazzling_smile";
std::string a_gentle_guy = "guy_in_love";

His just a wish to make her all happy and No-one knows how he
manages all this against every odds. I don't know about the real
scenario but let's create a bond within them, As;
std::pair loving_couple;
loving_couple = std::make_pair(pretty_gal,
a_gentle_guy);

Even I am lacking, the exact sentiments of the guy, but all that he
need, is her happiness may be as; he wants his identification with
that only. I or Any guy, just can imagine that how deeply he is
attached with her and I really don't have any experience of being
Gal So I think a Gal reader can visualize it some what similar.
(***Note*** (for Gal): ... Can Visualize It, If they have some good
coordination between heart and brain, All they lack at this point, I
know It.           Whatever Exceptions are always there)



So our gentle guy has mapped himself within the happiness of the
gal as;
std::multimap feeling_bond;
feeling_bond.insert (loving_couple);

Now if, you need to find the guy, you can make use of just a single
reference as gal's smile;
std::multimap::iterator _bond_;
_bond_ = feeling_bond.find("dazzling_smile");


Let’s change a Bit                                              Page 2
STL (Multimap) – C++

printf("%s for %s", _bond_->second.c_str(),
_bond_->first.c_str());

And the Output window will show you a message:
Output Window: "guy_in_love for dazzling_smile"

Yes It may possible, that you have some or all different
prospective with the concept and even with example or
scenario, that I had selected. I really don't need it. And
please don't try to certify this; I will hardly bother about
it.



As Always I thought to express my view in favor of concept I done
that, you don't like it, It's completely your choice and I will always
have respect for that. Programming is just Fun If you are capable
to enjoy it ... So ... Take Care ... in someone's style not mine, I used
to say ... Catch you again ...



The Overall code can be found as bellow and is running
successfully in Win32 Console Application with VC9 in
Visual Studio 2008.
//-------------------
//Code Snippet
//-------------------

#include             "stdafx.h"
#include             "iostream"
#include             "string"
#include             "map"

Let’s change a Bit                                                 Page 3
STL (Multimap) – C++


void test_func(void)
{
    std::string pretty_gal = "dazzling_smile";
    std::string a_gentle_guy = "guy_in_love";
    std::pair loving_couple;
    loving_couple = std::make_pair(pretty_gal,
a_gentle_guy);
    std::multimapfeeling_bond;
    feeling_bond.insert(loving_couple);
    std::multimap::iterator bond_itr;
    bond_itr =
feeling_bond.find("dazzling_smile");
    printf("%s for %s", bond_itr-
>second.c_str(), bond_itr->first.c_str());
}

int main()
{
    test_func();
    printf("nnn");
    return 0;
}




Let’s change a Bit                           Page 4
A Guy and gal in STL
A Guy and gal in STL

Contenu connexe

Tendances

Tír na nÓg - Ceacht 06
Tír na nÓg - Ceacht 06Tír na nÓg - Ceacht 06
Tír na nÓg - Ceacht 06Seomra Ranga
 
An Dochtúir sa Teach Ceacht 34
An Dochtúir sa Teach Ceacht 34An Dochtúir sa Teach Ceacht 34
An Dochtúir sa Teach Ceacht 34Seomra Ranga
 
Hóra a Pháid - Ceacht 07
Hóra a Pháid - Ceacht 07Hóra a Pháid - Ceacht 07
Hóra a Pháid - Ceacht 07Seomra Ranga
 
Tír na nÓg - Ceacht 3
Tír na nÓg - Ceacht 3Tír na nÓg - Ceacht 3
Tír na nÓg - Ceacht 3Seomra Ranga
 
Hóra a Pháid - Ceacht 09
Hóra a Pháid - Ceacht 09Hóra a Pháid - Ceacht 09
Hóra a Pháid - Ceacht 09Seomra Ranga
 
Dúisigh a Bhríd - Ceacht 32
Dúisigh a Bhríd - Ceacht 32Dúisigh a Bhríd - Ceacht 32
Dúisigh a Bhríd - Ceacht 32Seomra Ranga
 
Dúisigh a Bhríd - Ceacht 33
Dúisigh a Bhríd - Ceacht 33Dúisigh a Bhríd - Ceacht 33
Dúisigh a Bhríd - Ceacht 33Seomra Ranga
 
Dúisigh a Bhríd Ceacht 34
Dúisigh a Bhríd Ceacht 34Dúisigh a Bhríd Ceacht 34
Dúisigh a Bhríd Ceacht 34Seomra Ranga
 
Hóra a Pháid - Ceacht 11
Hóra a Pháid - Ceacht 11Hóra a Pháid - Ceacht 11
Hóra a Pháid - Ceacht 11Seomra Ranga
 
Dúisigh a Bhríd - Ceacht 31
Dúisigh a Bhríd - Ceacht 31Dúisigh a Bhríd - Ceacht 31
Dúisigh a Bhríd - Ceacht 31Seomra Ranga
 
Hóra a Pháid - Ceacht 08
Hóra a Pháid - Ceacht 08Hóra a Pháid - Ceacht 08
Hóra a Pháid - Ceacht 08Seomra Ranga
 
An Dochtúir sa Teach - Ceacht 29
An Dochtúir sa Teach - Ceacht 29An Dochtúir sa Teach - Ceacht 29
An Dochtúir sa Teach - Ceacht 29Seomra Ranga
 
Dúisigh a Bhríd - Ceacht 37
Dúisigh a Bhríd - Ceacht 37Dúisigh a Bhríd - Ceacht 37
Dúisigh a Bhríd - Ceacht 37Seomra Ranga
 

Tendances (13)

Tír na nÓg - Ceacht 06
Tír na nÓg - Ceacht 06Tír na nÓg - Ceacht 06
Tír na nÓg - Ceacht 06
 
An Dochtúir sa Teach Ceacht 34
An Dochtúir sa Teach Ceacht 34An Dochtúir sa Teach Ceacht 34
An Dochtúir sa Teach Ceacht 34
 
Hóra a Pháid - Ceacht 07
Hóra a Pháid - Ceacht 07Hóra a Pháid - Ceacht 07
Hóra a Pháid - Ceacht 07
 
Tír na nÓg - Ceacht 3
Tír na nÓg - Ceacht 3Tír na nÓg - Ceacht 3
Tír na nÓg - Ceacht 3
 
Hóra a Pháid - Ceacht 09
Hóra a Pháid - Ceacht 09Hóra a Pháid - Ceacht 09
Hóra a Pháid - Ceacht 09
 
Dúisigh a Bhríd - Ceacht 32
Dúisigh a Bhríd - Ceacht 32Dúisigh a Bhríd - Ceacht 32
Dúisigh a Bhríd - Ceacht 32
 
Dúisigh a Bhríd - Ceacht 33
Dúisigh a Bhríd - Ceacht 33Dúisigh a Bhríd - Ceacht 33
Dúisigh a Bhríd - Ceacht 33
 
Dúisigh a Bhríd Ceacht 34
Dúisigh a Bhríd Ceacht 34Dúisigh a Bhríd Ceacht 34
Dúisigh a Bhríd Ceacht 34
 
Hóra a Pháid - Ceacht 11
Hóra a Pháid - Ceacht 11Hóra a Pháid - Ceacht 11
Hóra a Pháid - Ceacht 11
 
Dúisigh a Bhríd - Ceacht 31
Dúisigh a Bhríd - Ceacht 31Dúisigh a Bhríd - Ceacht 31
Dúisigh a Bhríd - Ceacht 31
 
Hóra a Pháid - Ceacht 08
Hóra a Pháid - Ceacht 08Hóra a Pháid - Ceacht 08
Hóra a Pháid - Ceacht 08
 
An Dochtúir sa Teach - Ceacht 29
An Dochtúir sa Teach - Ceacht 29An Dochtúir sa Teach - Ceacht 29
An Dochtúir sa Teach - Ceacht 29
 
Dúisigh a Bhríd - Ceacht 37
Dúisigh a Bhríd - Ceacht 37Dúisigh a Bhríd - Ceacht 37
Dúisigh a Bhríd - Ceacht 37
 

En vedette

Wan Important Questions
Wan Important QuestionsWan Important Questions
Wan Important QuestionsSaket Pathak
 
Lab. Programs in C
Lab. Programs in CLab. Programs in C
Lab. Programs in CSaket Pathak
 
C++ lab assignment
C++ lab assignmentC++ lab assignment
C++ lab assignmentSaket Pathak
 
Data Structure in C (Lab Programs)
Data Structure in C (Lab Programs)Data Structure in C (Lab Programs)
Data Structure in C (Lab Programs)Saket Pathak
 
Multiple inheritance in c++
Multiple inheritance in c++Multiple inheritance in c++
Multiple inheritance in c++Saket Pathak
 

En vedette (8)

Wan Important Questions
Wan Important QuestionsWan Important Questions
Wan Important Questions
 
Wan notes
Wan notesWan notes
Wan notes
 
Lab. Programs in C
Lab. Programs in CLab. Programs in C
Lab. Programs in C
 
C++ lab assignment
C++ lab assignmentC++ lab assignment
C++ lab assignment
 
Pointers in c
Pointers in cPointers in c
Pointers in c
 
Recursion in c
Recursion in cRecursion in c
Recursion in c
 
Data Structure in C (Lab Programs)
Data Structure in C (Lab Programs)Data Structure in C (Lab Programs)
Data Structure in C (Lab Programs)
 
Multiple inheritance in c++
Multiple inheritance in c++Multiple inheritance in c++
Multiple inheritance in c++
 

Plus de Saket Pathak

GNU GCC - what just a compiler...?
GNU GCC - what just a compiler...?GNU GCC - what just a compiler...?
GNU GCC - what just a compiler...?Saket Pathak
 
Malloc, calloc, realloc
Malloc, calloc, reallocMalloc, calloc, realloc
Malloc, calloc, reallocSaket Pathak
 
C++ diamond problem
C++ diamond problemC++ diamond problem
C++ diamond problemSaket Pathak
 

Plus de Saket Pathak (6)

GNU GCC - what just a compiler...?
GNU GCC - what just a compiler...?GNU GCC - what just a compiler...?
GNU GCC - what just a compiler...?
 
C++ friendship
C++ friendshipC++ friendship
C++ friendship
 
C++ Template
C++ TemplateC++ Template
C++ Template
 
Copy constructor
Copy constructorCopy constructor
Copy constructor
 
Malloc, calloc, realloc
Malloc, calloc, reallocMalloc, calloc, realloc
Malloc, calloc, realloc
 
C++ diamond problem
C++ diamond problemC++ diamond problem
C++ diamond problem
 

Dernier

Culture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxCulture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxPoojaSen20
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxCarlos105
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)cama23
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptxiammrhaywood
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfErwinPantujan2
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 

Dernier (20)

Culture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxCulture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 

A Guy and gal in STL

  • 1. STL (Multimap) – C++ Guy and Gal in STL Hi, all it's really a long time that I was away from this all. Few days back while I was just working, I got a chance to implement Map/Multi-Map of C++(STL). And trust me I found a cute sketch with all innocence of the bond of love within a "Couple" or more suitable word that can I choose, will be "Pair" (means both of them are just completing each other), off course in Multi-Map/Map of STL. Here, I can bet you will realize my words are not just words but it's just the voice of your heart. For the shake of trust you can execute the code snippet. You can find the technical definition of the terms all over the internet and Off-course I will not waste my time for that. I think let's change our angle of position and have a look, you will find the imprints of complete love. I don't know you had ever loved anyone or not but yes, if you have any practical experience then you can visualize the portraits more clearly Okee, so lets have a short story about a pretty gal and a guy (ohh , you can imagine this as your friend ). Let’s change a Bit Page 1
  • 2. STL (Multimap) – C++ In my case, the gal is so pretty that the guy never ever wishes to see her nervous, sad or tense face. As; std::string pretty_gal = "dazzling_smile"; std::string a_gentle_guy = "guy_in_love"; His just a wish to make her all happy and No-one knows how he manages all this against every odds. I don't know about the real scenario but let's create a bond within them, As; std::pair loving_couple; loving_couple = std::make_pair(pretty_gal, a_gentle_guy); Even I am lacking, the exact sentiments of the guy, but all that he need, is her happiness may be as; he wants his identification with that only. I or Any guy, just can imagine that how deeply he is attached with her and I really don't have any experience of being Gal So I think a Gal reader can visualize it some what similar. (***Note*** (for Gal): ... Can Visualize It, If they have some good coordination between heart and brain, All they lack at this point, I know It. Whatever Exceptions are always there) So our gentle guy has mapped himself within the happiness of the gal as; std::multimap feeling_bond; feeling_bond.insert (loving_couple); Now if, you need to find the guy, you can make use of just a single reference as gal's smile; std::multimap::iterator _bond_; _bond_ = feeling_bond.find("dazzling_smile"); Let’s change a Bit Page 2
  • 3. STL (Multimap) – C++ printf("%s for %s", _bond_->second.c_str(), _bond_->first.c_str()); And the Output window will show you a message: Output Window: "guy_in_love for dazzling_smile" Yes It may possible, that you have some or all different prospective with the concept and even with example or scenario, that I had selected. I really don't need it. And please don't try to certify this; I will hardly bother about it. As Always I thought to express my view in favor of concept I done that, you don't like it, It's completely your choice and I will always have respect for that. Programming is just Fun If you are capable to enjoy it ... So ... Take Care ... in someone's style not mine, I used to say ... Catch you again ... The Overall code can be found as bellow and is running successfully in Win32 Console Application with VC9 in Visual Studio 2008. //------------------- //Code Snippet //------------------- #include "stdafx.h" #include "iostream" #include "string" #include "map" Let’s change a Bit Page 3
  • 4. STL (Multimap) – C++ void test_func(void) { std::string pretty_gal = "dazzling_smile"; std::string a_gentle_guy = "guy_in_love"; std::pair loving_couple; loving_couple = std::make_pair(pretty_gal, a_gentle_guy); std::multimapfeeling_bond; feeling_bond.insert(loving_couple); std::multimap::iterator bond_itr; bond_itr = feeling_bond.find("dazzling_smile"); printf("%s for %s", bond_itr- >second.c_str(), bond_itr->first.c_str()); } int main() { test_func(); printf("nnn"); return 0; } Let’s change a Bit Page 4