35 lines
521 B
C
35 lines
521 B
C
#include <errno.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
typedef struct {
|
|
double *st;
|
|
int cnt;
|
|
int size;
|
|
} STACK;
|
|
|
|
STACK *init_stack(int size);
|
|
|
|
void destroy_stack(STACK *s);
|
|
|
|
void push(STACK *st, double val);
|
|
|
|
double pop(STACK *st);
|
|
|
|
double top(STACK* st);
|
|
|
|
typedef struct {
|
|
char *st;
|
|
int cnt;
|
|
int size;
|
|
} CHAR_STACK;
|
|
|
|
CHAR_STACK *init_char_stack(int size);
|
|
|
|
void destroy_char_stack(CHAR_STACK *s);
|
|
|
|
void char_push(CHAR_STACK *st, char val);
|
|
|
|
char char_pop(CHAR_STACK *st);
|
|
|
|
char* char_top(CHAR_STACK* st); |