Browse Source

implementation of to_string()(resolve conflicts).

remotes/origin/beta
fdai7057 2 years ago
committed by fdai7207
parent
commit
ca1eda49c9
  1. 5
      src/CustomerProperties.h
  2. 24
      src/StringManipulation.c
  3. 3
      src/StringManipulation.h
  4. 9
      team.md

5
src/CustomerProperties.h

@ -0,0 +1,5 @@
typedef struct Customer{
int ID;
char *forename,*surname,*password;
float balance;
}customer_t;

24
src/StringManipulation.c

@ -0,0 +1,24 @@
#include "StringManipulation.h"
/*Code written by Julius Philipp Engel, fdai7057*/
char *to_string(int number)
{
if(number==0)
{
return "0\0";
}
else
{
int cpy = number, len = 0;
while(number>0){
++len;
number /= 10;
}
char *str = calloc(len+1, sizeof(char));
for(int i=0,j=len-1;i<len;++i,--j){
*(str+j) = '0' + (cpy % 10);
cpy /= 10;
}
*(str+len) = '\0';
return str;
}
}

3
src/StringManipulation.h

@ -0,0 +1,3 @@
#include <stdlib.h>
#include <stdio.h>
char *to_string(int);

9
team.md

@ -1,9 +0,0 @@
# Bankmanagement-System
- Can Hacioglu, Fdlt3817
- Atharva Kishor Naik, fdai7514
- Julius Philipp Engel, fdai7057
- Shivam Chaudhary, fdlt3781
- Mohamed Yahya Dahi, fdai6618
- Haytham Daoula, fdai7207
Loading…
Cancel
Save