Skip to content
Snippets Groups Projects
Commit 401c7daa authored by Florian Burgener's avatar Florian Burgener
Browse files

Add deleted field

parent f5491e86
No related branches found
No related tags found
No related merge requests found
File deleted
File deleted
#include "DirectoryRecord.h" #include "DirectoryRecord.h"
#include <stdbool.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
DirectoryRecord *DirectoryRecord_init(char phone_number[11], char name[21], char surname[21], int birth_date_year, int birth_date_month, int birth_date_day) { DirectoryRecord *DirectoryRecord_init(bool deleted, char phone_number[11], char name[21], char surname[21], int birth_date_year, int birth_date_month, int birth_date_day) {
DirectoryRecord *record = (DirectoryRecord *)malloc(sizeof(DirectoryRecord)); DirectoryRecord *record = (DirectoryRecord *)malloc(sizeof(DirectoryRecord));
record->deleted = deleted;
strcpy(record->phone_number, phone_number); strcpy(record->phone_number, phone_number);
strcpy(record->name, name); strcpy(record->name, name);
strcpy(record->surname, surname); strcpy(record->surname, surname);
......
#ifndef DIRECTORY_RECORD_H #ifndef DIRECTORY_RECORD_H
#define DIRECTORY_RECORD_H #define DIRECTORY_RECORD_H
#include <stdbool.h>
typedef struct DirectoryRecord { typedef struct DirectoryRecord {
bool deleted;
char phone_number[11]; char phone_number[11];
char name[21]; char name[21];
char surname[21]; char surname[21];
...@@ -10,7 +13,7 @@ typedef struct DirectoryRecord { ...@@ -10,7 +13,7 @@ typedef struct DirectoryRecord {
int birth_date_day; int birth_date_day;
} DirectoryRecord; } DirectoryRecord;
DirectoryRecord *DirectoryRecord_init(char phone_number[11], char name[21], char surname[21], int birth_date_year, int birth_date_month, int birth_date_day); DirectoryRecord *DirectoryRecord_init(bool deleted, char phone_number[11], char name[21], char surname[21], int birth_date_year, int birth_date_month, int birth_date_day);
void DirectoryRecord_destroy(DirectoryRecord **record); void DirectoryRecord_destroy(DirectoryRecord **record);
void DirectoryRecord_print(DirectoryRecord *record); void DirectoryRecord_print(DirectoryRecord *record);
......
File deleted
File deleted
File deleted
File deleted
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment