- #1
John O' Meara
- 330
- 0
Code:
class intList {
int value;
intList *nextEntry;
intList *reverseM(intList *prev);
public:
intList(int v, intList *next) : value(v), nextEntry(next){}
int getValue() { return value; }
intList *getNextEntry() { return nextEntry; }
intList *reverseM();
};
intList *readFowardList()
{
int inputval;
intList *front = NULL;
cout << "Enter number: " ; cin >> inputval;
while(!cin.eof()) {
front = new intList(inputval, front);
cout << "Enter number: "; cin >> inputval;
}
cout << '\n';
return front->reverseM();
}
int main() {
intList *theList;
cout << theList;
deleteList(theList);
return 0;
}