How to produce output using show function
<p>I am trying to use sho to show the output of another function.The first function was used to do sorting, and returned a List.</p>

<p>now I want to make a function that uses show() to display the output.This is how I had tried it only to get an error.</p>

<p>Its to diplay the results of two the two sorted lists which used this function.</p>

<pre><code>    //Function that does the compare!

    map&lt;int, Bid*&gt; Auctioneer::compareBidList(map&lt;int, Bid*&gt;&amp; one, map&lt;int, Bid*&gt;&amp; 
                   two) // pass references &amp;
     {
  map&lt;int, Bid*&gt; Sorted;
       map&lt;int, Bid*&gt;::iterator iterOne;
  for(iterOne = one.begin(); iterOne != one.end(); ++iterOne)
 {
    if(iterOne-&gt;second-&gt;bidType == 'A') // select all type A from one
    {
        map&lt;int, Bid*&gt;::iterator iterTwo;
        for(iterTwo = two.begin(); iterTwo != two.end(); ++iterTwo)
        {
            if(iterTwo-&gt;second-&gt;bidType == 'B') // select all
         type B from two
            {
                if(iterOne-&gt;second-&gt;price &lt; iterTwo-&gt;second-
                          &gt;price) // select on price between type A and type B
                {
                    Sorted.insert(*iterOne);
                    Sorted.insert(*iterTwo);
                }
            }
        }
    }
   }                
   return Sorted;
   }

 void show(map&lt;int, Bid*&gt;&amp; one, map&lt;int, Bid*&gt;&amp; two) { 
    map&lt;int, Bid*&gt;::iterator iterOne;
    map&lt;int, Bid*&gt;::iterator iterTwo;
   cout &lt;&lt; "-----------------The sorted List-------------------------";     
   for(iterOne=Sorted.begin(); iterOne!= Sorted.end(); iterOne++){
   cout &lt;&lt; iterOne-&gt;second-&gt;toString() &lt;&lt; endl&lt;&lt;"\n";}
   for(iterTwo=Sorted.begin(); iterTwo!= Sorted.end(); iterTwo){
   cout &lt;&lt; iterTwo-&gt;second-&gt;toString() &lt;&lt; endl&lt;&lt;"\n";}  
   }  

 void show(const char *msg, map&lt;int, Bid*&gt;&amp; Sorted) {  
       cout &lt;&lt; msg &lt;&lt; endl; 
       show(Sorted);
        }  
void compare(map&lt;int, Bid*&gt;&amp; sellers, map&lt;int, Bid*&gt;&amp; buyers) { 
    compare(sellers.begin(), sellers.end(),
    buyers.begin(),buyers.end(),compareBidList); } 

//my call in the main after declaration was as follows
   map&lt;int, Bid*&gt; buyers, sellers;
   auctioneer.compare(sellers,buyers);
   show("Bids after sorting:", sellers); 
   show(buyers); 
</code></pre>
