[Solved] How can a function finish it’s objective, only to break down after returning to main? [closed]


I had:

    for (int i=0; i<6;i++)
    {
        S[i].resize(n);
    }

where S is a std::vector.

I replaced 6 (the loop extent) with m (even though m = 6).

This seems to have solved the issue. Undefined behaviour at its best.

2

solved How can a function finish it’s objective, only to break down after returning to main? [closed]