|  |
|
|
|
|
The value 12.8 is stored into the component member of the first node. |
|
|
|
|
|
|
|
|
|
|
newNodePtr = new NodeType; |
|
|
|
|  |
|
|
|
|
A dynamic variable of type NodeType is created. The pointer to this new node is stored into newNodePtr. |
|
|
|
|
|
|
|
|
|
|
newNodePtr->component = 45.2; |
|
|
|
|  |
|
|
|
|
The value 45.2 is stored into the component member of the new node. |
|
|
|
|
|
|  |
|
|
|
|
The pointer to the new node containing 45.2 in its component member is copied into the link member of *head. Variable newNodePtr still points to this new node. The node can be accessed either as *newNodePtr or as *(head->link). |
|
|
|
|
|