In C++, we can replace struct by class:
{} class Node { int id ; double xCoord ; double yCoord ; }; ... Node* node ; // reserve space for memory address ... node = new Node() ; // reserve memory space for contents ... node->id = 213 ; xx = node->xCoord ;the use of new also solves the memory problem.4.1