coderz.py

Keep Coding Keep Cheering!

Multithreading in C++

What is Multithreading? Multithreading is a subset of multitasking, which is the feature that allows your computer to run two or more programs at the same time. Multitasking is classified into two types: process-based and thread-based. What is a Thread? A multithreaded program has two or more parts that can run simultaneously. Each component of […]

November 3, 2022 | C++ | No comments

Memory Management in C++

What is Memory Management? Memory management is defined as the process of managing a computer’s memory, such as assigning memory to programs, variables, and so on, in such a way that it does not affect overall performance. Need for Memory Management: Memory management is required to ensure that no memory is wasted and that allocation […]

November 2, 2022 | C++ | No comments

File Handling using File Streams in C++

A file is a medium for storing data or information. The sequence of bytes provided as input to the executing program and the sequence of bytes returned by the executing program is referred to as streams. File handling is the process of storing data permanently in a computer. We can store data in secondary memory […]

November 1, 2022 | C++ | No comments

Exception Handling in C++

What is an Exception? An exception is a problem that arises during the execution of a program. A C++ exception is a response to an exceptional circumstance that arises while a program is running What is Exception Handling? In C++, exception handling is the process of dealing with runtime errors. We handle exceptions so that […]

October 31, 2022 | C++ | No comments

Examples of Operator Overloading in C++

Let’s see examples of operator overloading in C++ for various types of operators. Examples: 1) Add given timestamps by overloading + operator setTime() function is used to set HR, MIN and SEC values. showTime() function displays the time in a specific format (HH:MM:SS). We add the seconds, minutes, and hours separately to get the new time […]

October 30, 2022 | C++ | No comments

Operator Overloading in C++

What is Operator Overloading? Operator overloading is a compile-time polymorphism in which the operator is overloaded to provide the user-defined data type with a special meaning. Most of the operators available in C++ are overloaded or redefined using operator overloading. It’s used to run an operation on a user-defined data type. Operators that can be […]

October 29, 2022 | C++ | No comments

Virtual Destructors in C++

What is a Virtual Destructor? Deleting a derived class object with a non-virtual destructor using a pointer of the base class type results in undefined behavior. While deleting instances of the derived class using a base class pointer object, a virtual destructor is used to free up the memory space allocated by the derived class […]

October 28, 2022 | C++ | No comments

Pure Virtual Functions and Abstract Classes

What are Pure Virtual Functions? A pure virtual function is a virtual function in C++ that does not require any function definition and is only declared. It is declared by assigning a value of 0 to the declaration. For instance, What is an Abstract Class? In C++, an abstract class has at least one pure […]

October 27, 2022 | C++ | No comments

Virtual Functions in C++

A virtual function is a member function declared in a base class that is re-defined (overridden) by a derived class. When you use a pointer or a reference to the base class to refer to a derived class object, you can call a virtual function for that object and execute the derived class’s version of […]

October 26, 2022 | C++ | No comments

Method Overriding(Polymorphism)

What is Polymorphism? The term “polymorphism” refers to having multiple forms. Polymorphism is defined as the ability of a message to be displayed in more than one form. There are two types of polymorphism: Compile-time Polymorphism. Runtime Polymorphism. Method Overriding: Function overriding is a concept in C++ that allows us to define a function with the […]

October 26, 2022 | C++ | No comments

Advertisement