>
</div>
<p>Let&#8217;s now try the same with a list. We create an empty list, add an element using the append method, and as before, call the array method</p>
<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="n">p</span><span class="o">::</span><span class="n">list</span> <span class="n">l</span><span class="p">;</span>
<span class="n">l</span><span class="p">.</span><span class="n">append</span><span class="p">(</span><span class="sc">&#39;a&#39;</span><span class="p">);</sp