What happens if you don't return a value in C++?

后端 未结 6 783
南方客
南方客 2020-12-28 18:56

Yesterday, I found myself writing code like this:

SomeStruct getSomeStruct()
{
    SomeStruct input;

    cin >> input.x;
    cin >> input.y;
}
<         


        
6条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-28 19:28

    For me the compiler didn't allow it: http://codepad.org/KkzVCesh

提交回复
热议问题