#include #include using namespace std; struct channelGuideType { int channelNumber; char chAbbrev[6]; char chFullName[40]; struct channelGuideType *next; }; // here is the old array declaration for comparison: // struct channelGuideType chGuide[57]; This is a Global Variable!!! // Here is the pointer declaration: struct channelGuideType *chGuide; int main() { struct channelGuideType *temp, *loopVar; chGuide = new (struct channelGuideType); chGuide->channelNumber = 22; strcpy(chGuide->chAbbrev, "TWC"); strcpy(chGuide->chFullName, "The Weather Channel"); chGuide->next = NULL; temp = new (channelGuideType); temp->channelNumber = 47; strcpy(temp->chAbbrev, "TSC"); strcpy(temp->chFullName, "The Science Channel"); temp->next = NULL; chGuide->next = temp; loopVar = chGuide; while (loopVar != NULL) { cout << "The channel number is " << loopVar->channelNumber << endl; cout << "The channel Abbreviation is " << loopVar->chAbbrev << endl; cout << "The channel full name is " << loopVar->chFullName << "\n\n"; loopVar = loopVar->next; } return 0; }