I'm from php
and when I define something like this:
$a = array();
echo $a[586];
I will get a notice about undefined index.
Meanwhile at c++
I can do this:
map<int, string> my_map;
cout << "Map is: " << my_map[34535];
string sentence = "acdefb s";
cout << "Letter is: " << sentence[15];
And I won't get any error.
Why it's not possible at php
and possible at c++
?