-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
42 lines (29 loc) · 783 Bytes
/
Copy pathmain.cpp
File metadata and controls
42 lines (29 loc) · 783 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
40
41
42
#include "check_stack.hpp"
#include "log.h"
//#include "stack_functions.hpp"
FILE *output_file = NULL;
const char *output_file_name = "output.txt";
int main ()
{
output_file = fopen (output_file_name, "w");
if (output_file == NULL)
{
printf ("open file error");
return 0;
}
Stack_t stack1 = {};
stack_ctor (stack1, 1);
for (int index = 0; index < 6; index++)
{
stack_push (&stack1, index*index);
}
// long *t = (long *) &stack1;
// *t = 0;
//stack1.capacity = 10;
//stack1.data[0] = 100;
stack_pop (&stack1);
stack_pop (&stack1);
stack_dump (output_file, &stack1, FULL);
stack_dtor (&stack1);
fclose (output_file);
}