gpt4 book ai didi

c - C 中的方法和结构

转载 作者:太空宇宙 更新时间:2023-11-04 02:44:36 24 4
gpt4 key购买 nike

我试图解决这个旧的实验表 - http://csis.bits-pilani.ac.in/faculty/murali/dsa-10/labsheet3_sec4.pdf

所以我的问题是我必须使用这种方法-

int createMaze(Maze *pm, char *mazefilename)

这将在迷宫中输入值。但由于它不返回迷宫,我如何在此方法中使用它-

Boolean findCheese(Maze m, int n, int posi, int posj, char
**path_so_far, int past_i, int past_j)

我也不能从 createMaze 调用 findCheese 方法,我必须从另一个 driver.c 文件调用它们。SO 是定义方法错误还是我可以在这两种方法中使用 Maze

最佳答案

在您链接到的文档中,它说:

Create a driver file maze.c for meeting the objectives of this problem. This creates the Maze using createMaze. It then calls findCheese to determine the path.

代码看起来像这样:

Maze m;
createMaze(&m, "some file name");
findCheese(m, ... rest of the arguments ...);

关于c - C 中的方法和结构,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28622204/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com