What does int & mean

后端 未结 6 772
隐瞒了意图╮
隐瞒了意图╮ 2020-12-12 15:39

A C++ question,

I know

int* foo(void)

foo will return a pointer to int type

how about

int &foo(void)
         


        
6条回答
  •  醉酒成梦
    2020-12-12 16:37

    This question isn't C/C++ at all, as C does not have references, only pointers. An int& is a reference to an int. Also, you don't need void, it can just be int& foo();

提交回复
热议问题