What does '&' mean in C++?

后端 未结 11 1600
隐瞒了意图╮
隐瞒了意图╮ 2021-01-18 02:20

What does \'&\' mean in C++?

As within the function

void Read_wav::read_wav(const string &filename)
{

}

And what is its equiv

11条回答
  •  北恋
    北恋 (楼主)
    2021-01-18 02:59

    It's a reference, as others have said. In C, you'd probably write the function as something like

    void read_wav(struct Read_wav* rw, const char* filename)
    {
    
    }
    

提交回复
热议问题