Category : C++ Source Code
Archive   : VECTOR2.ZIP
Filename : STCKTEST.C

 
Output of file : STCKTEST.C contained in archive : VECTOR2.ZIP
#include
#include
#include
#include "stack.h"
#include "vector.h"

int main()
{
sstack stack;
sparse_vector a("A"),b("B"),c("C"),*d,*e,*f,g("G");

d = new sparse_vector("D");
e = new sparse_vector("E");
f = new sparse_vector("F");

ifstream iFile("vector.dat", ios::in);

while ( iFile >> a )
stack.push(a);

cout << "Result POP: " << (*f = stack.pop()) << endl;
cout << "Result POP: " << (*e = stack.pop()) << endl;
cout << "Result POP: " << (*d = stack.pop()) << endl;
cout << "Result POP: " << (c = stack.pop()) << endl;
cout << "Result POP: " << (b = stack.pop()) << endl;
cout << "Result POP: " << (a = stack.pop()) << endl;

stack.push(a + b);
stack.push(*d + *e);
stack.push(stack.pop() + stack.pop());
g = stack.pop();

cout << g << endl;

g = c + *f;

cout << g << endl;
}


  3 Responses to “Category : C++ Source Code
Archive   : VECTOR2.ZIP
Filename : STCKTEST.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. 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/