diff --git a/CPlusPlus/CPlusPlus.sln b/CPlusPlus/CPlusPlus.sln
index 337d8d9..508f78b 100644
--- a/CPlusPlus/CPlusPlus.sln
+++ b/CPlusPlus/CPlusPlus.sln
@@ -1,10 +1,14 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
-VisualStudioVersion = 17.14.36414.22 d17.14
+VisualStudioVersion = 17.14.36414.22
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Intro", "Intro\Intro.vcxproj", "{87B7A7C3-105C-4950-9FFE-A7B05AA70780}"
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Forward_Declaration", "Forward_Declaration\Forward_Declaration.vcxproj", "{D70D8E56-EB48-42A1-8F65-D6D9F66E3736}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Classes", "Classes\Classes.vcxproj", "{6254C365-0DB4-44EB-A7FD-3AFA5980A219}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|ARM64 = Debug|ARM64
@@ -27,6 +31,30 @@ Global
{87B7A7C3-105C-4950-9FFE-A7B05AA70780}.Release|x64.Build.0 = Release|x64
{87B7A7C3-105C-4950-9FFE-A7B05AA70780}.Release|x86.ActiveCfg = Release|Win32
{87B7A7C3-105C-4950-9FFE-A7B05AA70780}.Release|x86.Build.0 = Release|Win32
+ {D70D8E56-EB48-42A1-8F65-D6D9F66E3736}.Debug|ARM64.ActiveCfg = Debug|ARM64
+ {D70D8E56-EB48-42A1-8F65-D6D9F66E3736}.Debug|ARM64.Build.0 = Debug|ARM64
+ {D70D8E56-EB48-42A1-8F65-D6D9F66E3736}.Debug|x64.ActiveCfg = Debug|x64
+ {D70D8E56-EB48-42A1-8F65-D6D9F66E3736}.Debug|x64.Build.0 = Debug|x64
+ {D70D8E56-EB48-42A1-8F65-D6D9F66E3736}.Debug|x86.ActiveCfg = Debug|Win32
+ {D70D8E56-EB48-42A1-8F65-D6D9F66E3736}.Debug|x86.Build.0 = Debug|Win32
+ {D70D8E56-EB48-42A1-8F65-D6D9F66E3736}.Release|ARM64.ActiveCfg = Release|ARM64
+ {D70D8E56-EB48-42A1-8F65-D6D9F66E3736}.Release|ARM64.Build.0 = Release|ARM64
+ {D70D8E56-EB48-42A1-8F65-D6D9F66E3736}.Release|x64.ActiveCfg = Release|x64
+ {D70D8E56-EB48-42A1-8F65-D6D9F66E3736}.Release|x64.Build.0 = Release|x64
+ {D70D8E56-EB48-42A1-8F65-D6D9F66E3736}.Release|x86.ActiveCfg = Release|Win32
+ {D70D8E56-EB48-42A1-8F65-D6D9F66E3736}.Release|x86.Build.0 = Release|Win32
+ {6254C365-0DB4-44EB-A7FD-3AFA5980A219}.Debug|ARM64.ActiveCfg = Debug|ARM64
+ {6254C365-0DB4-44EB-A7FD-3AFA5980A219}.Debug|ARM64.Build.0 = Debug|ARM64
+ {6254C365-0DB4-44EB-A7FD-3AFA5980A219}.Debug|x64.ActiveCfg = Debug|x64
+ {6254C365-0DB4-44EB-A7FD-3AFA5980A219}.Debug|x64.Build.0 = Debug|x64
+ {6254C365-0DB4-44EB-A7FD-3AFA5980A219}.Debug|x86.ActiveCfg = Debug|Win32
+ {6254C365-0DB4-44EB-A7FD-3AFA5980A219}.Debug|x86.Build.0 = Debug|Win32
+ {6254C365-0DB4-44EB-A7FD-3AFA5980A219}.Release|ARM64.ActiveCfg = Release|ARM64
+ {6254C365-0DB4-44EB-A7FD-3AFA5980A219}.Release|ARM64.Build.0 = Release|ARM64
+ {6254C365-0DB4-44EB-A7FD-3AFA5980A219}.Release|x64.ActiveCfg = Release|x64
+ {6254C365-0DB4-44EB-A7FD-3AFA5980A219}.Release|x64.Build.0 = Release|x64
+ {6254C365-0DB4-44EB-A7FD-3AFA5980A219}.Release|x86.ActiveCfg = Release|Win32
+ {6254C365-0DB4-44EB-A7FD-3AFA5980A219}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/CPlusPlus/Classes/Classes.vcxproj b/CPlusPlus/Classes/Classes.vcxproj
new file mode 100644
index 0000000..a84dfbb
--- /dev/null
+++ b/CPlusPlus/Classes/Classes.vcxproj
@@ -0,0 +1,193 @@
+
+
+
+
+ Debug
+ Win32
+
+
+ Release
+ Win32
+
+
+ Debug
+ x64
+
+
+ Release
+ x64
+
+
+ Debug
+ ARM64
+
+
+ Release
+ ARM64
+
+
+
+ 17.0
+ Win32Proj
+ {6254c365-0db4-44eb-a7fd-3afa5980a219}
+ Classes
+ 10.0
+
+
+
+ Application
+ true
+ v143
+ Unicode
+
+
+ Application
+ false
+ v143
+ true
+ Unicode
+
+
+ Application
+ true
+ v143
+ Unicode
+
+
+ Application
+ false
+ v143
+ true
+ Unicode
+
+
+ Application
+ true
+ v143
+ Unicode
+
+
+ Application
+ false
+ v143
+ true
+ Unicode
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Level3
+ true
+ WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ true
+
+
+ Console
+ true
+
+
+
+
+ Level3
+ true
+ true
+ true
+ WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ true
+
+
+ Console
+ true
+
+
+
+
+ Level3
+ true
+ _DEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ true
+
+
+ Console
+ true
+
+
+
+
+ Level3
+ true
+ true
+ true
+ NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ true
+
+
+ Console
+ true
+
+
+
+
+ Level3
+ true
+ _DEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ true
+
+
+ Console
+ true
+
+
+
+
+ Level3
+ true
+ true
+ true
+ NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ true
+
+
+ Console
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/CPlusPlus/Classes/Classes.vcxproj.filters b/CPlusPlus/Classes/Classes.vcxproj.filters
new file mode 100644
index 0000000..c37c9a3
--- /dev/null
+++ b/CPlusPlus/Classes/Classes.vcxproj.filters
@@ -0,0 +1,45 @@
+
+
+
+
+ {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
+ cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx
+
+
+ {93995380-89BD-4b04-88EB-625FBE52EBFB}
+ h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd
+
+
+ {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
+ rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
+
+
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+
\ No newline at end of file
diff --git a/CPlusPlus/Classes/Entity.cpp b/CPlusPlus/Classes/Entity.cpp
new file mode 100644
index 0000000..6c84dc5
--- /dev/null
+++ b/CPlusPlus/Classes/Entity.cpp
@@ -0,0 +1,12 @@
+#include "Entity.h" // project header files, pre compiler will search in project folder first
+#include // system header files, pre compiler will search in system folders first
+
+Entity::Entity() // defined
+{
+
+}
+
+Entity::Entity(std::string name) : _name(name)
+{
+ //_name = name;
+}
\ No newline at end of file
diff --git a/CPlusPlus/Classes/Entity.h b/CPlusPlus/Classes/Entity.h
new file mode 100644
index 0000000..10e756b
--- /dev/null
+++ b/CPlusPlus/Classes/Entity.h
@@ -0,0 +1,17 @@
+#pragma once
+#include
+
+class Entity
+{
+public:
+ Entity(); // declared
+ Entity(std::string name);
+
+ virtual std::string toString() { return "Entity"; } // declared & defined, only use that for one liners
+ std::string getName() { return _name; }
+ void setName(std::string name) { _name = name; }
+
+protected:
+ std::string _name = "";
+
+}; // IMPORTANT: always end with a semicolon
\ No newline at end of file
diff --git a/CPlusPlus/Classes/Monster.cpp b/CPlusPlus/Classes/Monster.cpp
new file mode 100644
index 0000000..77bcfd8
--- /dev/null
+++ b/CPlusPlus/Classes/Monster.cpp
@@ -0,0 +1,6 @@
+#include "Monster.h"
+
+Monster::Monster()
+{
+ //toString();
+}
diff --git a/CPlusPlus/Classes/Monster.h b/CPlusPlus/Classes/Monster.h
new file mode 100644
index 0000000..383627b
--- /dev/null
+++ b/CPlusPlus/Classes/Monster.h
@@ -0,0 +1,11 @@
+#pragma once
+#include "Entity.h"
+
+class Monster : public Entity
+{
+public:
+ Monster();
+
+ std::string toString() override { return "Monster"; }
+};
+
diff --git a/CPlusPlus/Classes/Ork.cpp b/CPlusPlus/Classes/Ork.cpp
new file mode 100644
index 0000000..35f3f25
--- /dev/null
+++ b/CPlusPlus/Classes/Ork.cpp
@@ -0,0 +1,6 @@
+#include "Ork.h"
+
+Ork::Ork()
+{
+ //toString();
+}
diff --git a/CPlusPlus/Classes/Ork.h b/CPlusPlus/Classes/Ork.h
new file mode 100644
index 0000000..35d898a
--- /dev/null
+++ b/CPlusPlus/Classes/Ork.h
@@ -0,0 +1,11 @@
+#pragma once
+#include "Monster.h"
+
+class Ork : public Monster
+{
+public:
+ Ork();
+
+ std::string toString() override { return "Ork"; }
+};
+
diff --git a/CPlusPlus/Classes/Vector3.h b/CPlusPlus/Classes/Vector3.h
new file mode 100644
index 0000000..139cab9
--- /dev/null
+++ b/CPlusPlus/Classes/Vector3.h
@@ -0,0 +1,11 @@
+#pragma once
+
+struct Vector3
+{
+ float x;
+ float y;
+ float z;
+
+ Vector3() : x(0.0f), y(0.0f), z(0.0f) {}
+ Vector3(float _x, float _y, float _z) : x(_x), y(_y), z(_z) {}
+};
\ No newline at end of file
diff --git a/CPlusPlus/Classes/main.cpp b/CPlusPlus/Classes/main.cpp
new file mode 100644
index 0000000..24c2e56
--- /dev/null
+++ b/CPlusPlus/Classes/main.cpp
@@ -0,0 +1,24 @@
+#include
+
+#include "Entity.h"
+#include "Monster.h"
+#include "Vector3.h"
+
+using namespace std;
+
+int main()
+{
+ Entity entity; // this is an entity instance
+ cout << entity.toString() << endl;
+
+ Monster monster;
+ cout << monster.toString() << endl;
+
+ Vector3 position;
+ Vector3 position2(1.0f, 0.0f, -10.0f);
+ Vector3 position3 = Vector3();
+ Vector3 position4{}; // list-initializer
+ Vector3 position5 = {}; // list-initializer assigned
+
+ return 0;
+}
\ No newline at end of file
diff --git a/CPlusPlus/Forward_Declaration/Forward_Declaration.vcxproj b/CPlusPlus/Forward_Declaration/Forward_Declaration.vcxproj
new file mode 100644
index 0000000..3f6860e
--- /dev/null
+++ b/CPlusPlus/Forward_Declaration/Forward_Declaration.vcxproj
@@ -0,0 +1,188 @@
+
+
+
+
+ Debug
+ Win32
+
+
+ Release
+ Win32
+
+
+ Debug
+ x64
+
+
+ Release
+ x64
+
+
+ Debug
+ ARM64
+
+
+ Release
+ ARM64
+
+
+
+ 17.0
+ Win32Proj
+ {d70d8e56-eb48-42a1-8f65-d6d9f66e3736}
+ ForwardDeclaration
+ 10.0
+
+
+
+ Application
+ true
+ v143
+ Unicode
+
+
+ Application
+ false
+ v143
+ true
+ Unicode
+
+
+ Application
+ true
+ v143
+ Unicode
+
+
+ Application
+ false
+ v143
+ true
+ Unicode
+
+
+ Application
+ true
+ v143
+ Unicode
+
+
+ Application
+ false
+ v143
+ true
+ Unicode
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Level3
+ true
+ WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ true
+
+
+ Console
+ true
+
+
+
+
+ Level3
+ true
+ true
+ true
+ WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ true
+
+
+ Console
+ true
+
+
+
+
+ Level3
+ true
+ _DEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ true
+
+
+ Console
+ true
+
+
+
+
+ Level3
+ true
+ true
+ true
+ NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ true
+
+
+ Console
+ true
+
+
+
+
+ Level3
+ true
+ _DEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ true
+
+
+ Console
+ true
+
+
+
+
+ Level3
+ true
+ true
+ true
+ NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ true
+
+
+ Console
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/CPlusPlus/Forward_Declaration/Forward_Declaration.vcxproj.filters b/CPlusPlus/Forward_Declaration/Forward_Declaration.vcxproj.filters
new file mode 100644
index 0000000..54bcd79
--- /dev/null
+++ b/CPlusPlus/Forward_Declaration/Forward_Declaration.vcxproj.filters
@@ -0,0 +1,30 @@
+
+
+
+
+ {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
+ cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx
+
+
+ {93995380-89BD-4b04-88EB-625FBE52EBFB}
+ h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd
+
+
+ {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
+ rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
+
+
+
+
+ Source Files
+
+
+ Source Files
+
+
+
+
+ Header Files
+
+
+
\ No newline at end of file
diff --git a/CPlusPlus/Forward_Declaration/functions.cpp b/CPlusPlus/Forward_Declaration/functions.cpp
new file mode 100644
index 0000000..b8ef9f9
--- /dev/null
+++ b/CPlusPlus/Forward_Declaration/functions.cpp
@@ -0,0 +1,3 @@
+#include "functions.h"
+
+void functionE() {} // defined
\ No newline at end of file
diff --git a/CPlusPlus/Forward_Declaration/functions.h b/CPlusPlus/Forward_Declaration/functions.h
new file mode 100644
index 0000000..6737ae0
--- /dev/null
+++ b/CPlusPlus/Forward_Declaration/functions.h
@@ -0,0 +1,10 @@
+#pragma once
+
+#ifndef _FUNCTIONS_H_
+#define _FUNCTIONS_H_
+
+void functionE(); // declared
+
+//void functionF() {} // declared & defined, linker error when included multiple times
+
+#endif // !_FUNCTIONS_H_
diff --git a/CPlusPlus/Forward_Declaration/main.cpp b/CPlusPlus/Forward_Declaration/main.cpp
new file mode 100644
index 0000000..ceb667a
--- /dev/null
+++ b/CPlusPlus/Forward_Declaration/main.cpp
@@ -0,0 +1,20 @@
+#include "functions.h"
+
+void functionB() {} // declared & defined
+void functionC(); // declared
+void functionD(); // declared
+
+int main()
+{
+ //functionA(); // compiler error, because function is declared & defined after this call
+ functionB(); // no error
+ //functionC(); // linker error, because function is declared, but not defined
+ functionD(); // no error
+ functionE(); // no error
+
+ return 0;
+}
+
+void functionA() {} // declared & defined
+
+void functionD() {} // defined
\ No newline at end of file
diff --git a/CPlusPlus/Intro/main.cpp b/CPlusPlus/Intro/main.cpp
index f6a8b2f..242f2f8 100644
--- a/CPlusPlus/Intro/main.cpp
+++ b/CPlusPlus/Intro/main.cpp
@@ -4,6 +4,7 @@ using namespace std;
int main()
{
+ // console output
std::cout << "Hello World" << std::endl;
std::cout << 1234 << std::endl;
std::cout << "Another test!\n";
@@ -15,5 +16,16 @@ int main()
cout << L"Hello World" << endl; // wide character string literal, can not be handled by cout
+ // console input
+ cin >> number;
+ cout << "input: " << number << endl;
+
+ char c;
+ cin >> c;
+ cout << "input: " << c << endl;
+
+ cin >> c >> number;
+ cout << c << ": " << number << endl;
+
return 0;
}
\ No newline at end of file