Write your question here.
ok so this is just a part of the whole code... after running
i don't get to see content of the vector on terminal...
but the size comes out as 24...
????
1 2 3 4 5 6 7 8 9 10 11 12 13
std::cout<<std::endl;
std::cout<<"size of last vector is "<<sizeof(values_to_play)<<std::endl;
std::cout<<"this are values to play:"<<std::endl;
for(auto ptr = values_to_play.begin(); ptr != values_to_play.end(); ptr++)
{
std::cout<<values_to_play[*ptr]<<", ";
}
std::cout<<std::endl;
std::cout<<"values to play size is "<<sizeof(values_to_play);
this is what appears on terminal? Isn't it strange ?
1 2 3 4 5 6 7 8 9 10 11 12 13
size of last vector is 24
this are values to play:
values to play now 24
row - minus is 300
THIS IS NO. OF ROWS 300
Process returned 0 (0x0) execution time : 0.029 s
Press ENTER to continue.
There are several errors in that code you have posted.
1) sizeof does not get the length of the vector, it gets the size of vector object. Use .length instead: values_to_play.length()
2) When using iterators, all you need to do is dereference the iterator: std::cout<<*ptr<<", ";