< previous page page_1053 next page >

Page 1053
head->component = 12.8;
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
The value 12.8 is stored into the component member of the first node.
1053-01.gif
newNodePtr = new NodeType;
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
A dynamic variable of type NodeType is created. The pointer to this new node is stored into newNodePtr.
1053-02.gif
newNodePtr->component = 45.2;
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
The value 45.2 is stored into the component member of the new node.
1053-03.gif
head->link = newNodePtr;
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
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).
1053-04.gif

 
< previous page page_1053 next page >