This program prints out "bye" at the very end and then segfaults. I have no idea why. I think it might have something to do with the global vector? I've played around with it and discovered that if I take away the cout << i,j and the cout << endl, it will segfault without printing anything. n,p,k, and T aren't very big, at most 30.
int n, p, k;
vector<vector<int>> plates;
int main() {
int T;
cin >> T;
for (int t = 1; t != 1 + T; ++t) {
cin >> n >> k >> p;
plates.resize(n + 1, vector<int>(k + 1, 0));
for (int i = 1; i <= n; ++i) {
for (int j = 1; j <= k; ++j) {
cin >> plates[i][j];
cout << i << "," << j << "\t";
}
cout << endl;
}
}
cout << "bye" << endl;
}