commit cce320f2a5049ed9ebe51fe081af6044a5d11e1a Author: Greg Gauthier Date: Thu Jul 20 19:36:44 2023 +0100 initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3f5dcf4 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +cmake-build-debug/ diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/NewProject.iml b/.idea/NewProject.iml new file mode 100644 index 0000000..f08604b --- /dev/null +++ b/.idea/NewProject.iml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..79b3c94 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..c0690cd --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..a8ded4a --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,6 @@ +cmake_minimum_required(VERSION 3.22) +project(NewProject) + +set(CMAKE_CXX_STANDARD 17) + +add_executable(NewProject src/main.cpp src/inc1/convo.cpp src/inc1/greet.cpp src/inc1/respond.cpp src/inc1/respond2.cpp src/inc3/calculator.cpp src/inc3/calculator.h) diff --git a/src/inc1/convo.cpp b/src/inc1/convo.cpp new file mode 100644 index 0000000..e899fd4 --- /dev/null +++ b/src/inc1/convo.cpp @@ -0,0 +1,9 @@ +void greet(); +void respond(); +void respond2(); + +void convo() { + greet(); + respond(); + respond2(); +} \ No newline at end of file diff --git a/src/inc1/greet.cpp b/src/inc1/greet.cpp new file mode 100644 index 0000000..4011475 --- /dev/null +++ b/src/inc1/greet.cpp @@ -0,0 +1,5 @@ +#include + +void greet() { + std::cout << "Hello, there!" << std::endl; +} \ No newline at end of file diff --git a/src/inc1/respond.cpp b/src/inc1/respond.cpp new file mode 100644 index 0000000..115cb53 --- /dev/null +++ b/src/inc1/respond.cpp @@ -0,0 +1,5 @@ +#include + +void respond() { + std::cout << "Nice to meet you!" << std::endl; +} \ No newline at end of file diff --git a/src/inc1/respond2.cpp b/src/inc1/respond2.cpp new file mode 100644 index 0000000..151a379 --- /dev/null +++ b/src/inc1/respond2.cpp @@ -0,0 +1,5 @@ +#include + +void respond2() { + std::cout << "Likewise, to be sure!" << std::endl; +} \ No newline at end of file diff --git a/src/inc2/fruit.cpp b/src/inc2/fruit.cpp new file mode 100644 index 0000000..6500402 --- /dev/null +++ b/src/inc2/fruit.cpp @@ -0,0 +1,8 @@ +// +// Created by gmgauthier on 20/07/23. +// +#include + +void fruit() { + std::cout << "Let's not mix apples and oranges, here!" << std::endl; +} \ No newline at end of file diff --git a/src/inc3/calculator.cpp b/src/inc3/calculator.cpp new file mode 100644 index 0000000..4deaa90 --- /dev/null +++ b/src/inc3/calculator.cpp @@ -0,0 +1,21 @@ +// +// Created by gmgauthier on 20/07/23. +// +#include + +int sum(int x, int y) { + return x+y; +} + +int diff(int x, int y) { + return x - y; +} + +int prod(int x, int y) { + return x*y; +} + +[[maybe_unused]] void outmsg(const std::string& message) { + std::cout << message << std::endl; +} + diff --git a/src/inc3/calculator.h b/src/inc3/calculator.h new file mode 100644 index 0000000..aecd9ed --- /dev/null +++ b/src/inc3/calculator.h @@ -0,0 +1,15 @@ +// +// Created by gmgauthier on 20/07/23. +// + +#ifndef NEWPROJECT_CALCULATOR_H +#define NEWPROJECT_CALCULATOR_H + +#include + +int sum(int, int); +int diff(int, int); +int prod(int, int); +void outmsg(const std::string&); + +#endif //NEWPROJECT_CALCULATOR_H diff --git a/src/main.cpp b/src/main.cpp new file mode 100644 index 0000000..86ed401 --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,13 @@ +#include "inc2/fruit.cpp" +#include "inc3/calculator.h" +void convo(); + +int main() { + convo(); + fruit(); + std::cout << sum(2, 2) << std::endl; + std::cout << diff(10, 4) << std::endl; + std::cout << prod(12, 4) << std::endl; + outmsg("Do you like my math?"); + return 0; +}