#include "source.h" #include #include #include struct vessel create_vessel(const char *p_name, double p_length, double p_depth, struct cargo p_crg) { struct vessel vene; strncpy(vene.name, p_name, 30); vene.name[30] = '\0'; vene.length = p_length; vene.depth = p_depth; vene.crg = p_crg; return vene; } void print_vessel(const struct vessel *ship) { printf("%s\n", ship->name); printf("%.1f\n", ship->length); printf("%.1f\n", ship->depth); printf("%s\n", ship->crg.title); printf("%.1d\n", ship->crg.quantity); printf("%.1f\n", ship->crg.weight); }