C++ insert 1 letter in position 4 how to do it
<p>C++ insert 1 letter in position 4 how to do it</p>

<p>I have a string like</p>

<p>EURUSD</p>

<p>How do i make it into EUR/USD</p>

<p>I tried something like</p>

<pre><code>string result;
result = "EURUSD";

result.insert(3,"/");
</code></pre>

<p>and it doesnt work.</p>

<pre><code>main.cpp:202:24: error: passing ‘const string {aka const std::basic_string&lt;char&gt;}’ as ‘this’ argument of ‘std::basic_string&lt;_CharT, _Traits, _Alloc&gt;&amp; std::basic_string&lt;_CharT, _Traits, _Alloc&gt;::insert(std::basic_string&lt;_CharT, _Traits, _Alloc&gt;::size_type, const _CharT*) [with _CharT = char, _Traits = std::char_traits&lt;char&gt;, _Alloc = std::allocator&lt;char&gt;, std::basic_string&lt;_CharT, _Traits, _Alloc&gt; = std::basic_string&lt;char&gt;, std::basic_string&lt;_CharT, _Traits, _Alloc&gt;::size_type = unsigned int]’ discards qualifiers [-fpermissive]
main.cpp:203:2: error: expected ‘;’ before ‘cout’
</code></pre>
