0
#include <iostream>
using namespace std;
int main()
{
 
 int a[5]={1,2,3,4,5};
 cout<<a[5]<<endl; 
return 0; 
}

why do I get a garbage value instead of "out of range" error?

HolyBlackCat
  • 63,700
  • 7
  • 105
  • 170

0 Answers0