#include <iostream>
#include <string>
#include <vector>
int main()
{
const std::vector<std::string> Months {
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December"
};
Months[3] = "Oh no!";
std::cout << Months[3] << std::endl;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgojaW5jbHVkZSA8dmVjdG9yPgoKaW50IG1haW4oKQp7Cgljb25zdCBzdGQ6OnZlY3RvcjxzdGQ6OnN0cmluZz4gTW9udGhzIHsKCQkiSmFudWFyeSIsCgkJIkZlYnJ1YXJ5IiwKCQkiTWFyY2giLAoJCSJBcHJpbCIsCgkJIk1heSIsCgkJIkp1bmUiLAoJCSJKdWx5IiwKCQkiQXVndXN0IiwKCQkiU2VwdGVtYmVyIiwKCQkiT2N0b2JlciIsCgkJIk5vdmVtYmVyIiwKCQkiRGVjZW1iZXIiCgl9OwoKCU1vbnRoc1szXSA9ICJPaCBubyEiOwoJc3RkOjpjb3V0IDw8IE1vbnRoc1szXSA8PCBzdGQ6OmVuZGw7Cn0K
prog.cpp: In function ‘int main()’:
prog.cpp:22:12: error: passing ‘const value_type {aka const std::basic_string<char>}’ as ‘this’ argument of ‘std::basic_string<_CharT, _Traits, _Alloc>& std::basic_string<_CharT, _Traits, _Alloc>::operator=(const _CharT*) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]’ discards qualifiers [-fpermissive]
Months[3] = "Oh no!";
^