diff --git a/arrays/a.out b/OOP/a.out similarity index 57% rename from arrays/a.out rename to OOP/a.out index d000456..2ee7394 100755 Binary files a/arrays/a.out and b/OOP/a.out differ diff --git a/OOP/class_methode_outside.cpp b/OOP/class_methode_outside.cpp new file mode 100644 index 0000000..6635a53 --- /dev/null +++ b/OOP/class_methode_outside.cpp @@ -0,0 +1,23 @@ +#include + +/* + Here we have a Class which has a Function that is declared outside of the Class itself ; + We just reference the Function inside the class and later outside create a Function with this structure: + class::function() +*/ + +using namespace std; + +class outside { + public: + void coolFunc(); +}; + +void outside::coolFunc() { + cout << "I am a cool Outside Function\n"; +}; + +int main() { + outside classobj; + classobj.coolFunc(); // No cout needed here for some reason ; idk why +} \ No newline at end of file diff --git a/OOP/class_methodes.cpp b/OOP/class_methodes.cpp new file mode 100644 index 0000000..89ce4b1 --- /dev/null +++ b/OOP/class_methodes.cpp @@ -0,0 +1,19 @@ +#include +/* + Within a Class you can define Functions (called Methodes) ; you can define these to all datatypes you want but just be careful to not segfault +*/ + +using namespace std; + +class MethodConstruction { + public: + void myCoolFunction() { + cout << "I am a very Cool Function and I got called!\n"; + } +}; + +int main() { + MethodConstruction classobj; + classobj.myCoolFunction(); + return 0; +} \ No newline at end of file diff --git a/OOP/simple.cpp b/OOP/simple.cpp new file mode 100644 index 0000000..863d11a --- /dev/null +++ b/OOP/simple.cpp @@ -0,0 +1,23 @@ +#include + +using namespace std; + + +/* So basically a class is a template for data you can use anywhere ; so here you can def myVar to a int and a string to mystring and later output + that into a Object of that class (marked later in program) +*/ +class MyClass { + public: + int myVar; + string myString; +}; + +int main() { + + MyClass classobj1; + classobj1.myString = "You*re gay"; + classobj1.myVar = 25565; + + cout << classobj1.myString << "\n" << classobj1.myVar; + +} \ No newline at end of file diff --git a/a.out b/a.out deleted file mode 100755 index 24d67af..0000000 Binary files a/a.out and /dev/null differ diff --git a/arrays/py/sizeof_loop.py b/arrays/py/sizeof_loop.py new file mode 100644 index 0000000..488b135 --- /dev/null +++ b/arrays/py/sizeof_loop.py @@ -0,0 +1,6 @@ +# dynamarray (c++topy) + +numbers = [1,1,2,2,34,45,5,6,7,2,3,34] + +for i in range(0, len(numbers)): + print(numbers[i]) \ No newline at end of file diff --git a/arrays/sizeof_loop.cpp b/arrays/sizeof_loop.cpp index 26664f8..f8ca453 100644 --- a/arrays/sizeof_loop.cpp +++ b/arrays/sizeof_loop.cpp @@ -1,3 +1,9 @@ +/* + +We use the sizeof Opperator here to determine the size of the Array "numbers" {in this case 10} ; +After that we print "i" Element in "numbers" + +*/ #include using namespace std; diff --git a/switch/a.out b/switch/a.out new file mode 100755 index 0000000..a1ac209 Binary files /dev/null and b/switch/a.out differ diff --git a/switch/switchcase.cpp b/switch/switchcase.cpp new file mode 100644 index 0000000..5a7984b --- /dev/null +++ b/switch/switchcase.cpp @@ -0,0 +1,37 @@ +#include + +using namespace std; + +int main() { + int day; + cout << "Tag in Nummer: \n"; + cin >> day; + + switch (day) + { + case 1: + cout << "Montag"; + break; + case 2: + cout << "Dienstag"; + break; + case 3: + cout << "Mittwoch"; + break; + case 4: + cout << "Donnerstag"; + break; + case 5: + cout << "Freitag"; + break; + case 6: + cout << "Samstag"; + break; + case 7: + cout << "Sonntag"; + break; + default: + cout << "Nummer von 1 bis 7!"; + break; + } +} \ No newline at end of file