我目前正在学习C++,并且面临着难以使我的函数的参数正确。作业:用于C++函数的参数
的问题,我的截图:
到目前为止我的代码是:
int countInRange(Vector<int> array, int min, int max){
/*
Actual code goes here......
*/
return 0;
}
现在的编译器不接受Vector<int> array
,并引发了我这个错误:
no match for 'operator=' (operand types are 'Vector<int>' and '<brace-enclosed initializer list>') param0 = {28, 1, 17, 4, 41, 9, 59, 8, 31, 30, 25};
我知道这个问题是使用斯坦福标准库,但我不认为这是主要问题。
我将不胜感激修复Vector<int> array
部分的任何帮助。谢谢!
感谢您的帮助!据我所知,标准库“的std ::载体”可能是从斯坦福大学的图书馆“载体”不同的资本“V”:
http://stanford.edu/~stepp/cppdoc/Vector-class.html
我会尽量提供更多的信息对大家有帮助。
如果来自'std',Vector'应该是'vector'(所有小写字母) –
您能显示param0的声明吗?我猜这是一个矢量,因此你试图分配的任务是无效的。 –
audio
欢迎来到堆栈溢出。请发布[MCVE](http://stackoverflow.com/help/mcve)。 –