-
Notifications
You must be signed in to change notification settings - Fork 1
/
read.c
64 lines (55 loc) · 1.46 KB
/
read.c
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#include <stdio.h>
#include <stdlib.h>
// Read Function
int read(){
fflush(stdin);
printf("Read Function Is Activated\n\n\n");
printf(" .--. _\n");
printf(" .---|__| .\(\(\\-.\n");
printf(" .--|===|--|/ , \\\n");
printf(" | |===| |\\ y\n");
printf(" | | | | `.__,'\n");
printf(" | | | | / \\\\\\\n");
printf(" | | | |/| | \\`----.\n");
printf(" | | | ||\\ \\ |___.'_\n");
printf(" _| | |__||,\\ \\-+-._.' )_\n");
printf(" / | |===|--|\\ \\ \\ / \\\n");
printf(" / `--^---'--' `--`-'---^-' \\\n");
printf(" '================================`\n\n");
//Input
FILE *input;
char diary[12]; //diary is diary name
char text[500];
char text2[500];
printf("Diary's Date [dd-mm-yyyy]: ");
gets(diary);
input=fopen(diary,"r");
fflush(stdin);
//Loop For Reading different rows
while(fgets(text,500,input)!=NULL){
sscanf(text,"%[^\n]",text2);
printf("%s",text);
}
fclose(input);
system("pause");
int i;
printf("Continue Reading ?\n\n1 :Yes\n2: No\nChoice : ");
scanf("%d",&i);
switch (i){
case 1 :{
read();
break;}
case 2 :{
printf("Okay, Returning To The Main Menu\n");
system("pause");
menu();
break;
}
default :{
printf("Error Selection, Lets Go To The Main Menu\n");
system("pause");
menu();
break;
}
}
}