From b22b7f213f24c9dd33bdd570c9c2f500cbe04352 Mon Sep 17 00:00:00 2001 From: David Hackbarth Date: Fri, 6 Feb 2026 12:22:28 +0100 Subject: [PATCH] Add `.gitignore` for IntelliJ IDEA and initial CMake configuration. --- .idea/.gitignore | 10 ++ .idea/editor.xml | 249 +++++++++++++++++++++++++++++ .idea/encodings.xml | 4 + .idea/hwr2024_b.iml | 8 + .idea/modules.xml | 8 + .idea/vcs.xml | 6 + cpp/.gitignore | 69 ++++++++ cpp/.idea/.gitignore | 10 ++ cpp/.idea/cpp.iml | 2 + cpp/.idea/editor.xml | 345 ++++++++++++++++++++++++++++++++++++++++ cpp/.idea/encodings.xml | 4 + cpp/.idea/misc.xml | 7 + cpp/.idea/modules.xml | 8 + cpp/.idea/vcs.xml | 6 + cpp/CMakeLists.txt | 7 + cpp/functions.cpp | 6 + cpp/functions.h | 12 ++ cpp/main.cpp | 55 +++++++ 18 files changed, 816 insertions(+) create mode 100644 .idea/.gitignore create mode 100644 .idea/editor.xml create mode 100644 .idea/encodings.xml create mode 100644 .idea/hwr2024_b.iml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 cpp/.gitignore create mode 100644 cpp/.idea/.gitignore create mode 100644 cpp/.idea/cpp.iml create mode 100644 cpp/.idea/editor.xml create mode 100644 cpp/.idea/encodings.xml create mode 100644 cpp/.idea/misc.xml create mode 100644 cpp/.idea/modules.xml create mode 100644 cpp/.idea/vcs.xml create mode 100644 cpp/CMakeLists.txt create mode 100644 cpp/functions.cpp create mode 100644 cpp/functions.h create mode 100644 cpp/main.cpp diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..ab1f416 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,10 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Ignored default folder with query files +/queries/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml +# Editor-based HTTP Client requests +/httpRequests/ diff --git a/.idea/editor.xml b/.idea/editor.xml new file mode 100644 index 0000000..fef3201 --- /dev/null +++ b/.idea/editor.xml @@ -0,0 +1,249 @@ + + + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..df87cf9 --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/hwr2024_b.iml b/.idea/hwr2024_b.iml new file mode 100644 index 0000000..bc2cd87 --- /dev/null +++ b/.idea/hwr2024_b.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..708f292 --- /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..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/cpp/.gitignore b/cpp/.gitignore new file mode 100644 index 0000000..b2262d0 --- /dev/null +++ b/cpp/.gitignore @@ -0,0 +1,69 @@ +# Prerequisites +*.d + +# Compiled Object files +*.slo +*.lo +*.o +*.obj + +# Precompiled Headers +*.gch +*.pch + +# Linker files +*.ilk + +# Debugger Files +*.pdb + +# Compiled Dynamic libraries +*.so +*.dylib +*.dll +*.so.* + + +# Fortran module files +*.mod +*.smod + +# Compiled Static libraries +*.lai +*.la +*.a +*.lib + +# Executables +*.exe +*.out +*.app + +# Build directories +build/ +Build/ +build-*/ + +# CMake generated files +CMakeFiles/ +CMakeCache.txt +cmake_install.cmake +Makefile +install_manifest.txt +compile_commands.json + +# Temporary files +*.tmp +*.log +*.bak +*.swp + +# vcpkg +vcpkg_installed/ + +# debug information files +*.dwo + +# test output & cache +Testing/ +.cache/ \ No newline at end of file diff --git a/cpp/.idea/.gitignore b/cpp/.idea/.gitignore new file mode 100644 index 0000000..ab1f416 --- /dev/null +++ b/cpp/.idea/.gitignore @@ -0,0 +1,10 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Ignored default folder with query files +/queries/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml +# Editor-based HTTP Client requests +/httpRequests/ diff --git a/cpp/.idea/cpp.iml b/cpp/.idea/cpp.iml new file mode 100644 index 0000000..4c94235 --- /dev/null +++ b/cpp/.idea/cpp.iml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/cpp/.idea/editor.xml b/cpp/.idea/editor.xml new file mode 100644 index 0000000..8d0e15e --- /dev/null +++ b/cpp/.idea/editor.xml @@ -0,0 +1,345 @@ + + + + + \ No newline at end of file diff --git a/cpp/.idea/encodings.xml b/cpp/.idea/encodings.xml new file mode 100644 index 0000000..df87cf9 --- /dev/null +++ b/cpp/.idea/encodings.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/cpp/.idea/misc.xml b/cpp/.idea/misc.xml new file mode 100644 index 0000000..0b76fe5 --- /dev/null +++ b/cpp/.idea/misc.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/cpp/.idea/modules.xml b/cpp/.idea/modules.xml new file mode 100644 index 0000000..e009e75 --- /dev/null +++ b/cpp/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/cpp/.idea/vcs.xml b/cpp/.idea/vcs.xml new file mode 100644 index 0000000..6c0b863 --- /dev/null +++ b/cpp/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt new file mode 100644 index 0000000..9be06d8 --- /dev/null +++ b/cpp/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 4.1) +project(cpp) + +set(CMAKE_CXX_STANDARD 20) + +add_executable(cpp main.cpp + functions.cpp) diff --git a/cpp/functions.cpp b/cpp/functions.cpp new file mode 100644 index 0000000..d62b871 --- /dev/null +++ b/cpp/functions.cpp @@ -0,0 +1,6 @@ +// +// Created by David Hackbarth on 06.02.26. +// +#include "functions.h" + +void functionE() {} \ No newline at end of file diff --git a/cpp/functions.h b/cpp/functions.h new file mode 100644 index 0000000..10ed8d4 --- /dev/null +++ b/cpp/functions.h @@ -0,0 +1,12 @@ +#pragma once +// +// Created by David Hackbarth on 06.02.26. +// + +#ifndef CPP_FUNCTIONS_H +#define CPP_FUNCTIONS_H + +void functionE(); +// void functionF() {} + +#endif //CPP_FUNCTIONS_H \ No newline at end of file diff --git a/cpp/main.cpp b/cpp/main.cpp new file mode 100644 index 0000000..7ec8326 --- /dev/null +++ b/cpp/main.cpp @@ -0,0 +1,55 @@ +#include +#include "functions.h" + +using namespace std; + +void functionB() { +} + +void functionC(); // forward declaration +void functionD(); // forward declaration + +int main() { + const char *lang = "C++"; + std::cout << "Hello and welcome to " << lang << "!\n"; + + for (int i = 1; i <= 5; i++) { + std::cout << "i = " << i << std::endl; + } + + // functionA(); // compiler error - function is defined after call + functionB(); // no error - function is defined before call + // functionC(); // linker error - function is declared but not defined + functionD(); // no error - function is declared and defined + functionE(); + // functionF(); // linker error - function is defined twice + + // byte b; + short s; + int i; + long l; + long long ll; + + cout << "size of short: " << sizeof(s) << endl; + cout << "size of int: " << sizeof(i) << endl; + cout << "size of long: " << sizeof(l) << endl; + cout << "size of long long: " << sizeof(ll) << endl; + + int* pI = nullptr; + pI = &i; + *pI = 10; + pI = new int; + pI = new int(); // CAUTION - memory leak created + pI = new int(10); // CAUTION - memory leak created + delete pI; + pI = nullptr; + + int& rI = i; // reference + + return 0; +} + +void functionA() { +} + +void functionD() {} \ No newline at end of file