Could someone please explain the difference between a “reference” and a “pointer” in this case?

后端 未结 4 1002
忘了有多久
忘了有多久 2020-12-19 09:34

When I read litb answer to this question, I learned that passing an array by reference allows us to obtain its size. I just played little bit with code, and tried to pass a

4条回答
  •  眼角桃花
    2020-12-19 10:23

    I think it is due to the C++ Standard 4.3:

    An lvalue of function type T can be converted to an rvalue of type “pointer to T.” The result is a pointer to the function.

提交回复
热议问题