aakashyadav2000's blog

By aakashyadav2000, history, 2 years 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?

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

search google for undefined behaviour