37 lines
575 B
C
37 lines
575 B
C
#include <stdarg.h>
|
|
#include <stdbool.h>
|
|
#include <stdint.h>
|
|
#include <stdlib.h>
|
|
|
|
typedef struct T {
|
|
bool a;
|
|
uint8_t b;
|
|
} T;
|
|
|
|
typedef uint8_t Shape_Tag;
|
|
#define Circle 0
|
|
#define Rectangle 1
|
|
|
|
typedef struct Circle_Body {
|
|
double radius;
|
|
} Circle_Body;
|
|
|
|
typedef struct Rectangle_Body {
|
|
double width;
|
|
double height;
|
|
} Rectangle_Body;
|
|
|
|
typedef struct Shape {
|
|
Shape_Tag tag;
|
|
union {
|
|
Circle_Body circle;
|
|
Rectangle_Body rectangle;
|
|
} body;
|
|
} Shape;
|
|
|
|
void hello(const char *c);
|
|
|
|
void hello_struct(const struct T *t);
|
|
|
|
void hello_shape(const struct Shape *s);
|