#include <iostream> using namespace std; int main() { int arr[10] = {}; for(auto element : arr) { cout<<element<<" "; } cout<<endl; }
if I write int arr[10] = {} , the elements in arr all 0 . but if I just wrtie int arr[10] , the elements in arr are random. So I'm confused about int arr[10] = {} , I just declare an array int arr[10] , but I don't give it any value, just {} .
source share