From 854366fd97621c450d5d63fecad583c7f98cf416 Mon Sep 17 00:00:00 2001 From: fdai7057 Date: Thu, 2 Feb 2023 09:06:10 +0100 Subject: [PATCH] Implementation of function power(). --- src/createCustomer.c | 1 - src/loginCustomer.c | 1 - src/stringManipulation.c | 6 +++--- src/stringManipulation.h | 2 +- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/createCustomer.c b/src/createCustomer.c index 58ee01d..434c76f 100644 --- a/src/createCustomer.c +++ b/src/createCustomer.c @@ -21,7 +21,6 @@ void collectCustomerProperties() bool inputTooLong = false; printf("To create a new user, enter the information required below.\n"); printf("Enter forename (max. 15 letters):\n"); - userInput = getchar(); while(letterCounterIDAsString); char *searchForThisString = generateCheckString(IDAsNumber,c->password); - printf("Searching for: %s\n", searchForThisString); char *lineFromCustomerFile = calloc(40,sizeof(char)); FILE *readCustomerFile = fopen("CustomerData.txt", "r"); if(readCustomerFile==NULL){ diff --git a/src/stringManipulation.c b/src/stringManipulation.c index a9f39ef..228cc8c 100644 --- a/src/stringManipulation.c +++ b/src/stringManipulation.c @@ -54,10 +54,10 @@ char *to_string(int number) } } -unsigned int powerOfTen(unsigned int n){ +unsigned int power(unsigned int b, unsigned int n){ unsigned int result = 1, ctr = 0; while(ctr