Category : Recently Uploaded Files
Archive   : HEADZIP.EXE
Filename : CSTACK.CPP
// IMPLEMENTATION FILE (cstack.cpp)
// This module exports an ADT for a stack of characters.
// Stack representation: a vector.
//----------------------------------------------------------------------
#include "cstack.h"
// Private members of class:
// int top; // Subscript of current top item (or -1 if
// // stack is empty)
// char data[MAX_LENG]; // Vector representing the stack
//
// CLASSINV: -1 <= top < MAX_LENG
CharStack::CharStack()
//..................................................................
// Constructor
// POST: top == -1
//..................................................................
{
top = -1;
}
Boolean CharStack::IsEmpty() const
//..................................................................
// POST: FCTVAL == (top == -1)
//..................................................................
{
return (top == -1);
}
Boolean CharStack::IsFull() const
//..................................................................
// POST: FCTVAL == (top == MAX_LENG-1)
//..................................................................
{
return (top == MAX_LENG-1);
}
void CharStack::Push( /* in */ char newItem )
//..................................................................
// PRE: top < MAX_LENG-1 && Assigned(newItem)
// POST: top == top
// && data[top
//..................................................................
{
data[++top] = newItem;
}
char CharStack::Top() const
//..................................................................
// PRE: top >= 0
// POST: FCTVAL == data[top]
//..................................................................
{
return data[top];
}
void CharStack::Pop()
//..................................................................
// PRE: top
// POST: top == top
//..................................................................
{
top--;
}
Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!
This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.
But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/