Add stage 2: C

This commit is contained in:
stickynotememo
2025-12-18 16:15:14 +11:00
parent 0672bcedff
commit 2c058a159f
+14
View File
@@ -0,0 +1,14 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
extern char* _1_assembly_func(void);
char* _2_c_func() {
char * asm_buf = _1_assembly_func();
char * buf = malloc(22 + 16);
memcpy(buf, asm_buf, 22);
strcat(buf, "\nHello from C.");
printf("%s", buf);
return buf;
}