aboutsummaryrefslogtreecommitdiff
path: root/hi.c
diff options
context:
space:
mode:
authorHyder <hyder@hyderhadi.xyz>2025-07-22 13:30:17 +0300
committerHyder <hyder@hyderhadi.xyz>2025-07-22 13:30:17 +0300
commitf42909282a6cb7bd3ff600db683289cc0144a3ad (patch)
tree9415e942f6ab6ae5774747f9315d2e849eee9fde /hi.c
parent66951268ec5c61d94338ddea38eef51e7cd5dd52 (diff)
Deleted a file as an experiment XD
Diffstat (limited to 'hi.c')
-rw-r--r--hi.c40
1 files changed, 0 insertions, 40 deletions
diff --git a/hi.c b/hi.c
deleted file mode 100644
index 3d15edb..0000000
--- a/hi.c
+++ /dev/null
@@ -1,40 +0,0 @@
-# include <stdio.h>
-# include <stdlib.h>
-
-// REUSABLE INTEGER ARRAY IN CASE YOU NEED AN INTEGER ARRAY
-typedef struct {
- int *data;
- int size;
- int capacity;
-} IntArray;
-
-void initArray(IntArray *arr, int initialCapacity) {
- arr->data = malloc(initialCapacity * sizeof(int));
- arr->size = 0;
- arr->capacity = initialCapacity;
-}
-
-void append(IntArray *arr, int value) {
- if (arr->size >= arr->capacity) {
- arr->capacity *= 2;
- arr->data = realloc(arr->data, arr->capacity * sizeof(int));
- if (arr->data == NULL) {
- printf("Reallocate failed!!\n");
- exit(1);
- }
- }
-
- arr->data[arr->size] = value;
- arr->size++;
-}
-
-int main () {
- int x = 5;
- int y = x++;
- printf("%d\n", y);
- y = ++x;
- printf("%d\n\n", y);
-
-
- return 0;
-} \ No newline at end of file