意見交換
#include <iostream>
int main()
{
int arr[5] = { 1, 2, 3, 4, 5 };
try
{
std::cout << arr[6] << std::endl;
}
catch(...)
{
std::cout << "例外発生" << std::endl;
}
}
実行すると 16215297 と表示されました。
範囲外アクセスをしているのに例外が発生しないのは何故でしょうか。
回答1件
あなたの回答
tips
プレビュー
下記のような回答は推奨されていません。
このような回答には修正を依頼しましょう。
退会済みユーザー
2019/10/01 16:50
2019/10/02 02:10