-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
50 lines (40 loc) · 1.18 KB
/
Copy pathmain.cpp
File metadata and controls
50 lines (40 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
Archivo: main.tpp
Autor: David T. Montoya
e-mail: <[email protected]>
date start: 2020-11-20
Fdate last mod: 2020-11-20
Version: 0.2
Licencia: GPL
*/
#include "Element.h"
#include <iostream>
#include "Stack.h"
using namespace std;
int main()
{
//testing element template
Element<int> one(1, nullptr);
Element<int> two(2, &one);
Element<double> treeDec(3.44, nullptr );
Element<double> fourDec(4.55, &treeDec );
Element<string> hello("Hi,", nullptr );
Element<string> world("world", &hello );
Stack<int> pila;
cout<< "hla"<<endl<< two.valueNext() <<endl;
cout<< "prueba "<<"lenght de la pila: "<< pila.len()<<endl;
Stack<string> cadenas;
cadenas.push("entonces");
cadenas.push("qué pasó");
cadenas.push("con el ");
cadenas.push("programador x");
cout<<"Pila hecha en c++, esta es lo grande de la pila: "<<cadenas.len()<<endl;
cadenas.pop();
cout<<"Este es el top de la pila: "<<"'"+cadenas.top()+"'"<<endl;
//no olvidar: valgrind --tool=memcheck --leak-check=full ./main
//para los memoryleaks
//comandos para compilar
// $ g++ main.cpp -o Pila
// $ ./Pila
return 0;
}