-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFirstOpen_Fn.c
More file actions
26 lines (24 loc) · 801 Bytes
/
FirstOpen_Fn.c
File metadata and controls
26 lines (24 loc) · 801 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "Ansi_Colors.h"
#include "Structs.h"
#include "FirstOpen_Fn.h"
#include "Input_Fn.h"
void FirstOpen_Fn()
{
FILE *dir;
printf(ANSI_COLOR_RED "this is the first time you open the program so please enter your first contacts:- \n" ANSI_COLOR_RESET);
Data TheData;
Birth TheBirth;
Input_Fn(&TheData, &TheBirth, 0);
printf("\n\n");
dir = fopen("PhoneDirectory.txt", "w");
if(!dir)
{
printf(ANSI_COLOR_RED "There is something wrong!!" ANSI_COLOR_RESET);
exit(-1);
}
fprintf(dir, "%s,%s,%s-%s-%s,%s,%s,%s\n", TheData.lname, TheData.fname, TheBirth.day, TheBirth.month, TheBirth.year, TheData.adress, TheData.email, TheData.number);
fclose(dir);
}