这似乎有点补救.
我可以搜索一个文件,我可以打印一行,但对于我的生活,我无法弄清楚如何将两者放在一起.
假设我有一个功能:
int recursive(int NbProducts, int NbPlates, int NbPositions)
{ //the following is a recursive function that will call itself 3 times
//code to be repeated goes here
recursive(int NbProducts, int NbPlates, int NbPositions);
}
Run Code Online (Sandbox Code Playgroud)
我无法弄清楚的是如何让函数知道它所在的递归数,以及如何停止它。任何有效和聪明的方法来做到这一点?如果它有帮助,我正在使用 boost 算法。