Currently i'm tring to do 2d array in c++ that can have diffrent second column size. This is my code:
int **testZadanie;
testZadanie = new int*[testy];
...
for (int i = 0; i<testy; i++)
{
cin >> liczbaLakomczuchow >> liczbaCiastek;
testZadanie[i] = new int[liczbaLakomczuchow];
for (int j = 0; j<liczbaLakomczuchow; j++)
{
cin >> czasJedzenia;
//testZadanie[i, j] = czasJedzenia; this not works
*testZadanie[i, j] = czasJedzenia;
}
}
But when I want to attach values for each column i got exception. So i'm not sure if I can do this what i actually trying do ? ( declaring dynamic column element for each row and attach for each item in row ? )