2017-05-22 13:26:21 +00:00
|
|
|
#include <stdio.h>
|
2017-05-23 08:45:31 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <assert.h>
|
2017-05-22 13:26:21 +00:00
|
|
|
|
|
|
|
int main(int argc, char* argv[]){
|
2017-05-23 08:45:31 +00:00
|
|
|
|
|
|
|
#define STACK_TYPE double
|
|
|
|
#include "source/handystack.h"
|
|
|
|
double_stack s = new_double_stack();
|
2017-05-23 16:02:10 +00:00
|
|
|
push_double_stack(42.5, &s);
|
2017-05-23 08:45:31 +00:00
|
|
|
print_double_stack(s);
|
|
|
|
|
2017-05-23 16:02:10 +00:00
|
|
|
#ifdef LIST_TYPE
|
|
|
|
#undef LIST_TYPE
|
|
|
|
#endif
|
|
|
|
#define LIST_TYPE float
|
|
|
|
#include "source/handylist.h"
|
|
|
|
float_list* l = new_float_list(5.0, NULL);
|
|
|
|
add_float_list(6.0, l);
|
|
|
|
add_float_list(7.0, l);
|
|
|
|
add_float_list(8.0, l);
|
|
|
|
printf("%d\n", size_float_list(l));
|
|
|
|
printf("%f\n", get_float_list(3, l));
|
|
|
|
free_float_list(l);
|
|
|
|
|
2017-05-22 13:26:21 +00:00
|
|
|
}
|