snipt

Ctrl+h for KB shortcuts

C++

C++ map insert

std::map<int,string> output;
output.insert(pair<int,string>(1,"hehehe"));
https://snipt.net/embed/6033040a2fa80a777ab2475084878b70/
/raw/6033040a2fa80a777ab2475084878b70/
6033040a2fa80a777ab2475084878b70
cpp
C++
2
2019-05-23T03:38:54
True
False
False
Aug 22, 2012 at 03:21 AM
/api/public/snipt/46099/
c-map-insert
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="n">std</span><span class="o">::</span><span class="n">map</span><span class="o">&lt;</span><span class="kt">int</span><span class="p">,</span><span class="n">string</span><span class="o">&gt;</span> <span class="n">output</span><span class="p">;</span> </span><span id="L-2"><a name="L-2"></a><span class="n">output</span><span class="p">.</span><span class="n">insert</span><span class="p">(</span><span class="n">pair</span><span class="o">&lt;</span><span class="kt">int</span><span class="p">,</span><span class="n">string</span><span class="o">&gt;</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span><span class="s">&quot;hehehe&quot;</span><span class="p">));</span> </span></pre></div> </td></tr></table>
C++, map