我正在阅读Accelerated C++.我不明白练习5-1:
设计并实现一个程序,从以下输入产生置换索引.置换索引是指每个短语由短语中的每个单词索引的索引.
The quick brown fox
jumped over the fence
The quick brown fox
jumped over the fence
jumped over the fence
The quick brown fox
jumped over the fence
The quick brown fox
这个解释对我来说并不清楚.什么是置换索引?
我的代码如下:
#include <iostream>
using std::cout;
using std::endl;
int next(int n)
{
return n + 1;
}
int main()
{
int next(int); // function declaration
int *fp = &next;
int temp = 10;
temp = (*fp)(temp);
cout << temp << endl;
return 0;
}
Run Code Online (Sandbox Code Playgroud)
编译器点int *fp = &next;需要调试,但是,我没有发现这句话有什么问题.你能告诉我吗?谢谢你的时间~~
这是加速C++中的问题(3-3).
我是C++的新手.我已经考虑了很长时间了,但是,我无法弄明白.有人会为我解决这个问题吗?请详细解释,你知道我不擅长编程.告诉我你使用的变量的含义.