I was thinking today while reading about the default constructor of classes in C++ and let's say we have this code of the class SortedArray:
class SortedArray
{
private:
struct arrayCell
{
int pageID;
int totalNeighbors;
};
};
We assign an array of pointers pointing to objects of this class and then we initialize the pointers using the default constructor. What will happen? Will memory be stored for the structs? And if it is what will the int's be initialized to? Thanks.
ints will not be initialised unless you (zero|value)-initialise them.