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
  • 78,603
  • 9
  • 131
  • 207

0 Answers0