Add the basic code structure and build system
[Project_algorithmic_C.git] / lib / utils.c
diff --git a/lib/utils.c b/lib/utils.c
new file mode 100644 (file)
index 0000000..04a20e4
--- /dev/null
@@ -0,0 +1,13 @@
+#include "utils.h"
+
+void swap_int(int* v1, int* v2) {
+    int tmp = *v1;
+    *v1 = *v2;
+    *v2 = tmp;
+}
+
+void swap_ptr(void* v1, void* v2) {
+    void* tmp = v1;
+    v1 = v2;
+    v2 = tmp;
+}