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

[ad_1]

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

[ad_2]

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