Aman Kumar has Published 37 Articles

Why we should avoid using std::endl in C++

Aman Kumar

Aman Kumar

Updated on 15-May-2025 15:52:30

680 Views

In this article, we will see why we should avoid the std::endl while printing lines into the console or a file. We use std::endl to create a new line after the current line. For a few lines of I/O operations, it is not causing any problems. However, a large number ... Read More

reference_wrapper in C++

Aman Kumar

Aman Kumar

Updated on 15-May-2025 15:45:44

382 Views

std::reference_wrapper is a class template in C++ that allows you to store references to objects or functions in a way that makes them copyable and assignable. Normally, C++ references can't be stored in standard containers like std::vector or std::list, because references are not copyable. std::reference_wrapper solves this problem by internally ... Read More

Calculation in parent and child process using fork() in C++

Aman Kumar

Aman Kumar

Updated on 15-May-2025 15:44:05

2K+ Views

The fork() function creates a new process by duplicating the current one. It allows developers to perform parallel tasks and manage resources efficiently. When fork() is called, it returns a value. If the value is greater than 0, then it is in the parent process. Otherwise, it is in the ... Read More

Program to print hollow pyramid and diamond pattern in C++

Aman Kumar

Aman Kumar

Updated on 15-May-2025 15:41:35

7K+ Views

In this article, we implement a C++ program to print a hollow pyramid and diamond pattern. We can create solid Pyramid patterns easily using a loop. To make it hollow, we have to add a few logics. Hollow Pyramid A hollow pyramid is a pattern where a pyramid shape is ... Read More

Chrono library in C++

Aman Kumar

Aman Kumar

Updated on 15-May-2025 15:38:25

682 Views

; is a C++ header that is included in C++11 or later versions and states the collection of types and functions to work with time. It is a part of the C++ Standard Template Library (STL). Why We Need It provides a precision-neutral concept by separating the durations and ... Read More

C++ Program to Count Inversion in an Array

Aman Kumar

Aman Kumar

Updated on 15-May-2025 15:36:22

752 Views

The inverse count of an array indicates how far or how close the array is from being sorted. If the array is already sorted, then the inverse count is zero, but if the array is sorted in reverse order, then the inverse count is maximum. Here we have given an ... Read More

C++ Program to Implement a Binary Search Tree using Linked Lists

Aman Kumar

Aman Kumar

Updated on 15-May-2025 15:32:02

2K+ Views

A linked list is a linear data structure in which we store a sequence of elements, where each element is called a node that contains data and a pointer (or link) to the next element in the sequence. In this C++ article, we will implement a Binary search tree using a ... Read More

Advertisements