Name: Anonymous 2010-12-08 10:54
I have this function:
And I call it this way:
Why keep I getting these two errors?
main.cpp:139: error: invalid initialization of reference of type ‘std::vector<std::pair<float, float>, std::allocator<std::pair<float, float> > >&’ from expression of type ‘const std::vector<std::pair<float, float>, std::allocator<std::pair<float, float> > >’
main.cpp:8: error: in passing argument 1 of ‘void GenerarPuntos(std::vector<std::pair<float, float>, std::allocator<std::pair<float, float> > >&, const int&)’
void GenerarPuntos(vector<pair<float, float> > &V, const int &num) {And I call it this way:
GenerarPuntos(V, V.size());Why keep I getting these two errors?
main.cpp:139: error: invalid initialization of reference of type ‘std::vector<std::pair<float, float>, std::allocator<std::pair<float, float> > >&’ from expression of type ‘const std::vector<std::pair<float, float>, std::allocator<std::pair<float, float> > >’
main.cpp:8: error: in passing argument 1 of ‘void GenerarPuntos(std::vector<std::pair<float, float>, std::allocator<std::pair<float, float> > >&, const int&)’