ok the error says debug assertion failed vector subscript out of range line 779. Im nw to trying to use vectors so this is probably a simple and stupid question but it compiled with no problem but breaks as soon as i run the Clist function. Any help and maybe a bit of guidance where i went wrong with the vector would be
appreciated .
In this code, you are assigning a = 1 at the beginning of the loop? Other thing is vectors start from 0 and you are directly accessing it's first element in
std::vectors don't grow automatically.
Use std::vector::resize() to... well, resize it, and std::vector::push_back() to add an element to the back of the vector.
Also note that vectors, like arrays, use zero-based indexing, so the first element is 0, the second is 1, and so on. But don't let this confuse you into passing 0 to resize(). That will make the vector of size 0; it won't make element 0 the last element of the vector.