summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlexey Gavrilov <alexey.gavrilov@mail.com>2026-03-04 22:03:08 +0700
committerAlexey Gavrilov <alexey.gavrilov@mail.com>2026-03-04 22:03:08 +0700
commite7540462736b88d49ca56a7ca8461649f9c147fe (patch)
treed6069e7dfe74d2158e8cf0397d20c912384bee1d /src
parent902c6953e6a2b693129502f4f1eb075752e9ddb6 (diff)
Source directory
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt10
-rw-r--r--src/hwrld.cpp11
-rw-r--r--src/hwrld.h16
3 files changed, 37 insertions, 0 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
new file mode 100644
index 0000000..57dfa6d
--- /dev/null
+++ b/src/CMakeLists.txt
@@ -0,0 +1,10 @@
+cmake_minimum_required(VERSION 3.10)
+project(gocdtest CXX)
+
+message("${CMAKE_SOURCE_DIR}")
+
+add_executable(hwrld
+ ${CMAKE_SOURCE_DIR}/hwrld.cpp
+)
+
+target_compile_features(hwrld PRIVATE cxx_std_17)
diff --git a/src/hwrld.cpp b/src/hwrld.cpp
new file mode 100644
index 0000000..d486c74
--- /dev/null
+++ b/src/hwrld.cpp
@@ -0,0 +1,11 @@
+#include <iostream>
+#include <string>
+#include "hwrld.h"
+
+
+int main() {
+ std::string a = "Hello,", b = "World!";
+ std::cout << concat(a, b) << std::endl;
+ std::vector<int> is = {1, 2, 3, 4};
+ std::cout << sum_of_ints(is) << std::endl;
+}
diff --git a/src/hwrld.h b/src/hwrld.h
new file mode 100644
index 0000000..b0f7336
--- /dev/null
+++ b/src/hwrld.h
@@ -0,0 +1,16 @@
+#include <iostream>
+#include <vector>
+
+
+std::string concat(std::string &a, std::string &b) {
+ return a + ' ' + b;
+}
+
+int sum_of_ints(std::vector<int> &v) {
+ int sum = 0;
+ for(auto elm : v) {
+ sum += elm;
+ }
+
+ return sum;
+}