return list of values between parenthesis (10, 20, 30, 40)?

后端 未结 4 1230
自闭症患者
自闭症患者 2020-12-06 14:23

I am working in C++ (not C++/CLI) in Visual Studio 2012.

I don\'t understand why this code works, I would have expected it to fail

4条回答
  •  时光说笑
    2020-12-06 15:04

    You have used the , i.e. comma operator

    return () is valid.

    and so is return (/*valid evaluation*/)

    Comma operator returns the last value i.e 40

提交回复
热议问题