C++ insert 1 letter in position 4 how to do it
I have a string like
EURUSD
How do i make it into EUR/USD
I tried something like
string result;
result = "EURUSD";
result.insert(3,"/");
and it doesnt work.
main.cpp:202:24: error: passing ‘const string {aka const std::basic_string<char>}’ as ‘this’ argument of ‘std::basic_string<_CharT, _Traits, _Alloc>& std::basic_string<_CharT, _Traits, _Alloc>::insert(std::basic_string<_CharT, _Traits, _Alloc>::size_type, const _CharT*) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>, std::basic_string<_CharT, _Traits, _Alloc> = std::basic_string<char>, std::basic_string<_CharT, _Traits, _Alloc>::size_type = unsigned int]’ discards qualifiers [-fpermissive]
main.cpp:203:2: error: expected ‘;’ before ‘cout’