调用函数时传递结构数组的参数

Passing argument of struct array when calling the function

本文关键字:数组 参数 结构 函数 调用      更新时间:2023-10-16

我想知道当我如下调用函数时如何传递这个参数:

void edit_book(struct library lib[] );

在这里,我想用声明函数的参数调用函数:

edit_book();

我不知道在c++中传递参数的方法

在c++中传递参数非常容易,只需用结构库实例化一个数组并在参数中传递即可。

struct library{
// Make your struct library here
};
int main() {
  library mylib[2];
  edit_book(mylib);
  return 0;

}