#for loop issues, i think.

1 messages · Page 1 of 1 (latest)

sharp flax
#

when i run this. its causing ```c++
libc++abi: terminating with uncaught exception of type std::out_of_range: vector
[1] 89445 abort ./main

mossy micaBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.

sharp flax
#

nvm its a different bug. nothing wrong with the loop itself

#

smth wrong with these

#
dataHandler->get_training_data()->at(0)->get_double_feature_vector()->size(

dataHandler->get_class_counts()
craggy crystal
# sharp flax ```c++ dataHandler->get_training_data()->at(0)->get_double_feature_vector()->siz...

the error happens when you're trying to access a vector element that's outside the scope of it.

For example, the error happens when you try to access a vector element on index 5 when there's only 3 elements inside of that vector, which throws an out of range error.

I don't know where the error resides exactly since there's not enough information and context about the functions you've shown for me to confidently point out where it is, but try to look more carefully inside the vectors of your code to narrow down the source of the error.

sharp flax
#

Got it. Thx

compact haven
#

!solved

mossy micaBOT
sharp flax
#

!solved