Constructors in C++

https://youtu.be/aA1eXbbE9g8?si=cQxPodkm2DLpG9CM #include <iostream> using namespace std; class MyClass { public: int x, y; MyClass(int a, int b) { x = a; y = b; } }; int main() { MyClass…

Class Member Functions in C++

https://youtu.be/NenXdb9RQWU #include <iostream> using namespace std; class MyClass { public: int i; void myfunc(); void myfunc2() { cout << " Print some message" << endl; } }; void MyClass::myfunc() {…

Classes Introduction in C++

https://youtu.be/R9kBfrHKgyE?si=b02PlIi79Zvi7N3g #include <iostream> using namespace std; class MyClass { }; int main() { MyClass m; return 0; }

Operators new and delete in C++

https://youtu.be/H60O0oC0YKA?si=DkMelXXiDFHwsxzk #include <iostream> using namespace std; int main() { int *ptr = new int; *ptr = 100; cout << "The pointed to value is :" << *ptr << endl; delete…

Function Overloading in C++

https://youtu.be/uj03B502sh8 #include <iostream> using namespace std; void myfunc(char charValue); void myfunc(int intValue); void myfunc(double doubleValue); int main() { myfunc('c'); myfunc(12); myfunc(59.60); return 0; } void myfunc(char charValue) { cout <<…

Function Definition in C++

https://youtu.be/vKMzBGUcQfU #include <iostream> using namespace std; void myfunc(int x, int y); int main() { myfunc(2, 5); return 0; } void myfunc(int x, int y) { cout << x + y;…

Function Declaration in C++

https://youtu.be/WS9IabM4Vtw?si=pSq5hHz-tCWLEQf8 #include <iostream> using namespace std; void myfunc(); int myfunc2(int x); int myfunc3(int x, int y); int myfunc4(int, int); int main() { return 0; }