I need to write the code for getLength, isEmpty, and peek. I am unsure of what to write since I have never done this before.
Also, I need to write a loop in main that takes in an unknown number of positive integers, and pushes them onto the stack.
I am completely new to c++, so any help would be greatly appreciated.
#include <iostream>
using namespace std;
class Stack_int
{
private:
// Structure for the stack nodes
struct StackNode {
int value; // Value in the node
StackNode *next; // Pointer to next node
};
StackNode *top; // Pointer to the stack top
int length;