What does '&' mean in C++?

后端 未结 11 1678
隐瞒了意图╮
隐瞒了意图╮ 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:51

    & means that variable is passed via reference. So, inside your function you will have not a local copy of variable, but the original variable itself. All the changes to the variable inside the function will influence the original passed variable.

提交回复
热议问题