Browse Source

Base: Modify "little" project

Itamar 5 năm trước cách đây
mục cha
commit
e793cc3d13

+ 1 - 1
Base/home/anon/Source/little/Makefile

@@ -1,5 +1,5 @@
 PROGRAM = little
-OBJS = main.o
+OBJS = main.o other.o
 CXXFLAGS = -g
 
 all: $(PROGRAM)

+ 2 - 0
Base/home/anon/Source/little/little.hackstudio

@@ -2,3 +2,5 @@ main.cpp
 Makefile
 little.hackstudio
 test.frm
+other.cpp
+other.h

+ 2 - 0
Base/home/anon/Source/little/main.cpp

@@ -1,5 +1,6 @@
 #include <stdio.h>
 #include <sys/stat.h>
+#include "other.h"
 
 enum TestEnum {
     ValueOne,
@@ -19,6 +20,7 @@ int main(int, char**)
     printf("my_struct.x is %d\n", my_struct.x);
     for (int i = 0; i < 3; ++i) {
         // This is a comment :^)
+        func();
         printf("Hello friends!\n");
         mkdir("/tmp/xyz", 0755);
     }

+ 12 - 0
Base/home/anon/Source/little/other.cpp

@@ -0,0 +1,12 @@
+#include <stdio.h>
+#include "other.h"
+
+int func()
+{
+    int x = 1;
+    int y = 2;
+    printf("x: %d\n", x);
+    printf("y: %d\n", y);
+    printf("x+y: %d\n", x+y);
+    return x + y;
+}

+ 1 - 0
Base/home/anon/Source/little/other.h

@@ -0,0 +1 @@
+int func();