Update 1st June 26

This commit is contained in:
2026-06-01 13:15:48 +00:00
parent 79415e38db
commit bdde9bd1ca
15 changed files with 89 additions and 0 deletions
BIN
View File
Binary file not shown.
+18
View File
@@ -0,0 +1,18 @@
#include <stdio.h>
typedef unsigned char BYTE;
int main(int argc, char *argv[])
{
FILE *src = fopen(argv[1], "rb");
FILE *dst = fopen(argv[2], "wb");
BYTE b;
while (fread(&b, sizeof(b), 1, src) != 0)
{
fwrite(&b, sizeof(b), 1, dst);
}
fclose(dst);
fclose(src);
}
+2
View File
@@ -0,0 +1,2 @@
Hayet, 77666327
Munna, 59950786
1 Hayet 77666327
2 Munna 59950786
BIN
View File
Binary file not shown.
+20
View File
@@ -0,0 +1,20 @@
#include <cs50.h>
#include <stdio.h>
#include <string.h>
int main(void)
{
// FILE here calls FILE function from stdio.h & "a" using for apend.
FILE *file = fopen("phonebook.csv", "a");
if (file == NULL)
{
return 1;
}
char *name = get_string("Name: ");
char *number = get_string("Number: ");
fprintf(file, "%s, %s\n", name, number);
fclose(file);
return 0;
}
+2
View File
@@ -0,0 +1,2 @@
Hayet, 77666327
Munna, 59950786
1 Hayet 77666327
2 Munna 59950786