forked from rangken/AlgorithmStudy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_stack.cpp
More file actions
40 lines (33 loc) · 808 Bytes
/
Copy pathtest_stack.cpp
File metadata and controls
40 lines (33 loc) · 808 Bytes
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
#include <iostream>
#include "list.hpp"
using namespace std;
using namespace jy;
int main(int argc, char* argv[]){
cout << "----- list -----" << endl;
cout << "----- list<int> -----" << endl;
list<int> t;
int a = 1;
int b = 2;
int c = 3;
t.push_back(a);
t.push_back(b);
t.push_back(c);
for(list<int>::iterator iter = t.begin(); iter != t.end(); ++iter){
cout << *iter << endl;
}
cout << "----- list<int*> -----" << endl;
list<int*> t2;
int *pa = new int();
*pa = 4;
int *pb = new int();
*pb = 5;
int *pc = new int();
*pc = 6;
t2.push_back(pa);
t2.push_back(pb);
t2.push_back(pc);
for(list<int*>::iterator iter = t2.begin(); iter != t2.end(); ++iter){
cout << **iter << endl;
}
return 1;
}