Update 1st June 26
This commit is contained in:
Executable
BIN
Binary file not shown.
@@ -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);
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
Hayet, 77666327
|
||||
Munna, 59950786
|
||||
|
Executable
BIN
Binary file not shown.
@@ -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;
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
Hayet, 77666327
|
||||
Munna, 59950786
|
||||
|
Reference in New Issue
Block a user