I have something like the follow:
template<class T>
struct point{
point* next = nullptr;
T* data = nullptr;
}
template<class T>
class newClass
{
point<T>*** points;
public:
newClass()
{
points = new point<T>**[10];
for (int i = 0; i < 10; i++)
points[i] = new point<T>*[10];
for (int i = 0; i < 10; i++)
for(int j = 0; j < 10; j++)
if(j != 9)
points[i][j]->next = points[i][j+1]; //ERROR
}
};
Can someone help me understand why this produces an error? I don't receive an error message, the program just crashes.
std::vectoret al rather than re-inventing the wheel ?points[a][b]will bepoints[a][b+1].