Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

C++ references problem

Name: Anonymous 2010-12-08 10:54

I have this function:
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&)’

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List