Remove unused code and migrate to CMake build system.

This commit is contained in:
2026-02-13 16:05:08 +01:00
parent b22b7f213f
commit 90fbcc38dc
25 changed files with 2662 additions and 16 deletions
+7
View File
@@ -0,0 +1,7 @@
cmake_minimum_required(VERSION 4.1)
project(intro)
set(CMAKE_CXX_STANDARD 20)
add_executable(intro main.cpp
functions.cpp)
+6
View File
@@ -0,0 +1,6 @@
//
// Created by David Hackbarth on 06.02.26.
//
#include "functions.h"
void functionE() {}
+12
View File
@@ -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
+44
View File
@@ -0,0 +1,44 @@
#include <iostream>
#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;
return 0;
}
void functionA() {
}
void functionD() {}