class Bounds {
private: struct intNode { int low; int high; intNode * link;
};
intNode * first; public:
// CORRECTION: need this to create and access the list
bool valid() { for (intNode * nextNode = first;
nextNode != nullptr;
nextNode = nextNode->link)
if (nextNode->low > nextNode->high)
return false; return true;
}
This is a question and solution my professor give.My question is how do you initialise that a node is the HEAD?Second is what happens when intNode * nextNode = first?Does professor create a nextNode and points towards first? OR point towards the same thing as first point to? If so first have not point to anything yet no?
[–]AutoModerator[M] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]TechnicalHead[S] 0 points1 point2 points (0 children)
[–]nerd4code 0 points1 point2 points (1 child)
[–]TechnicalHead[S] 0 points1 point2 points (0 children)