From b2ab7c3665c0a9eee6e8f208f1974253ce37eec9 Mon Sep 17 00:00:00 2001 From: gonzo Date: Sat, 10 Jun 2023 00:22:33 +0200 Subject: user may now select loan_type --- read_functions.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 read_functions.c (limited to 'read_functions.c') diff --git a/read_functions.c b/read_functions.c new file mode 100644 index 0000000..d60b19e --- /dev/null +++ b/read_functions.c @@ -0,0 +1,12 @@ +#include "loans.h" + +loan_type read_loan_type(char **contract_subtypes, char *lt) { + int i = 0; + for (i = 0; lt[i]; i++) + if (lt[i] == ' ') lt[i] = '\0'; + + for (i = 0; contract_subtypes[i]; i++) + if (!strcmp(contract_subtypes[i], lt)) + return (loan_type)i; + return MORTGAGE; +} -- cgit v1.2.3