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
Executable
BIN
View File
Binary file not shown.
+9
View File
@@ -0,0 +1,9 @@
#include <stdio.h>
int main(void)
{
int n = 50;
int *p = &n;
printf("%p\n", p);
}
+7
View File
@@ -0,0 +1,7 @@
const iunt capacity = 50;
typedef struct
{
person people[CAPACITY]
int size;
} stack;
Executable
BIN
View File
Binary file not shown.
+10
View File
@@ -0,0 +1,10 @@
#include <stdio.h>
int main(void)
{
int scores[1024];
for (int i =0; i < 1024; i++)
{
printf("%i\n", scores[i]);
}
}
Submodule isiah/learning-area added at 31b3ff0a62
Executable
BIN
View File
Binary file not shown.
+17
View File
@@ -0,0 +1,17 @@
// Demonstrates memory error via valgrind
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
int *x = malloc(3 * sizeof(int));
{
return 1;
}
x[0] = 72;
x[1] = 73;
x[2] = 33;
free(x);
return 0;
}
+3
View File
@@ -20,3 +20,6 @@ vi .gitignore
- libcs50/
- a.out
// Memory Check
valgrind is an arcane software often useful for testing memory.