Aman Kumar has Published 94 Articles

How do I clear the cin buffer in C++?

Aman Kumar

Aman Kumar

Updated on 06-Jun-2025 19:39:15

2K+ Views

Before knowing the solution to clearing the cin buffer in C++, let us first see what the buffer is in C++. What is The Buffer in C++ A buffer is a temporary storage area that holds data while standard I/O devices are in use. In C++, a stream also work ... Read More

Stringize and Token-pasting operator in C

Aman Kumar

Aman Kumar

Updated on 06-Jun-2025 14:18:52

3K+ Views

In this article we will see what are the Stringize operator and Token Pasting operator in C. The stringize operator (#) and the token pasting operator (##) are preprocessor operators used within macros for text manipulation. It sends commands to compiler to convert a token into string. Stringize Operator ... Read More

StringStream in C++ for Decimal to Hexadecimal and back

Aman Kumar

Aman Kumar

Updated on 06-Jun-2025 14:18:31

881 Views

In this article, we will see how to convert a Decimal to a Hexadecimal string and versa in C++. For this conversion, we are using the string stream feature of C++. You can use StringStreams for formatting, parsing, converting a string into numeric values, and more. The Hex is ... Read More

Stack Unwinding in C++

Aman Kumar

Aman Kumar

Updated on 06-Jun-2025 14:11:37

2K+ Views

When we call some functions, the call stack stores the address, and after returning, it pops the address to resume work. What is Stack Unwinding Stack unwinding refers to the process of removing function call frames from the function call stack during runtime, wherein local objects are destroyed in the ... Read More

What happen if we concatenate two string literals in C++?

Aman Kumar

Aman Kumar

Updated on 06-Jun-2025 14:10:58

151 Views

In this article, we will explore what happens when we concatenate two string literals in C++. There are two important points to remember when concatenating strings in C++. Concatenation is another property of the string and string literals: let's see the following two properties below: ... Read More

How to convert std::string to LPCWSTR in C++?

Aman Kumar

Aman Kumar

Updated on 04-Jun-2025 18:53:51

3K+ Views

std::string The std::string is a class of C++ Standard Library (STL) that represents a string (sequence of characters). It is used to handle strings with better memory management, i.e., it provides dynamic memory management for strings and supports a rich set of in-built functions for string manipulation. Syntax Following is ... Read More

How to find length of a string without string.h and loop in C?

Aman Kumar

Aman Kumar

Updated on 04-Jun-2025 18:53:35

649 Views

C provides libraries for string operations such as the string.h header file that contains a strlen() function, which counts the length of a string. Otherwise, a loop can be used to count the string length. There are also different ways to find the length of a string apart from the ... Read More

How to convert std::string to LPCSTR in C++?

Aman Kumar

Aman Kumar

Updated on 04-Jun-2025 17:51:29

4K+ Views

std::string The std::string is a class of C++ Standard Library (STL) that represents a string (sequence of characters). It is used to handle strings with better memory management, i.e., it provides dynamic memory management for strings and supports a rich set of in-built functions for string manipulation. Syntax Following is ... Read More

C++ Program to Find Largest Rectangular Area in a Histogram

Aman Kumar

Aman Kumar

Updated on 04-Jun-2025 12:01:39

355 Views

A histogram is a visual representation of the distribution of quantitively data. You are given a histogram represented by an array arr [], Where each of the array's elements represents the height of the bar in the histogram. All the bars have unit width, i.e., 1 unit. Your task is ... Read More

C++ Program to Implement AVL Tree

Aman Kumar

Aman Kumar

Updated on 30-May-2025 18:42:56

23K+ Views

In this article, we will demonstrate how to implement an AVL tree. An AVL tree is a self-balancing binary search tree in which the height difference between the left and right subtrees (balance factor) of any node cannot exceed one. AVL TREE Following are the points of an AVL tree ... Read More

Advertisements