What is the issue with the following code snippet? #include <iostream> int main() { int* arr = new int[5]; arr[5] = 10; delete[] arr; return 0; } (2 Points) a) No issue b) Out-of-bounds array access c) Memory leak d) Missing std:: namespace
Question
What is the issue with the following code snippet?
#include <iostream>
int main() {
int* arr = new int[5];
arr[5] = 10;
delete[] arr;
return 0;
}
(2 Points)
a) No issue
b) Out-of-bounds array access
c) Memory leak
d) Missing std:: namespace
🧐 Not the exact question you are looking for?Go ask a question
Solution
b) Out-of-bounds array access
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.