What happens to uninitialized variables? C++

前端 未结 3 1527
北海茫月
北海茫月 2020-11-29 12:58
int main()
{    
    int a;
    cout << a;
    return 0;
}

I am wondering why the value 0 is being output. I thought if a variable is uniniti

3条回答
  •  时光取名叫无心
    2020-11-29 13:33

    I think you are not convinced with the answers/comments given, may be you can try the below code:

    #include 
    using namespace std;
    
    int main(){
    
     int a,b,c,d,e,f,g,h,i,j;
    
     cout<

提交回复
热议问题