aakashyadav2000's blog

By aakashyadav2000, history, 19 months ago, In English

include<bits/stdc++.h>

using namespace std; int main(){ int n;cin>>n; int arr[n]; cout<<arr[0]<<endl;   return 0; }

for n <1332 arr[0] is giving a garbage value but for n>=1332 arr[0]=0 can anyone pls tell me why?

  • Vote: I like it
  • 0
  • Vote: I do not like it

»
19 months ago, # |
  Vote: I like it +2 Vote: I do not like it

search google for undefined behaviour