Farhan Muhamed has Published 147 Articles

An Uncommon representation of array elements in C++ program

Farhan Muhamed

Farhan Muhamed

Updated on 09-Jun-2025 19:09:03

156 Views

In this article, we will learn an uncommon representation of array elements in both C and C++. Example of Uncommon Representation of Array Elements Consider following code in C/C++, that is trying to print an element from an array. ... Read More

What do single quotes do in C++ when used on multiple characters?

Farhan Muhamed

Farhan Muhamed

Updated on 06-Jun-2025 18:59:11

951 Views

Single quotes in C++ are used to denote characters, not strings. When you use single quotes around multiple characters or strings, C++ compiler will treat it as a multi-character literal, which will be stored as an integer value, representing the combined ASCII values of those characters. In this article, we will ... Read More

Why does std::getline() skip input after a formatted extraction?

Farhan Muhamed

Farhan Muhamed

Updated on 06-Jun-2025 18:58:39

514 Views

When using std::getline after a formatted extraction (like std::cin >>), you might see an unexpected behavior, where std::getline is skipping the next input line. In this article, we will understand why this happens and how to handle it. Getline skipping input after formatted extraction The code below shows how ... Read More

How to map C++ enums to strings?

Farhan Muhamed

Farhan Muhamed

Updated on 06-Jun-2025 18:58:17

3K+ Views

Here we will see how to map enum type data to a string in C++ There is no such direct function to do so. But we can create our own function to convert enum to string. We shall create a function that takes an enum value as the argument, and ... Read More

How to convert an enum type variable to a string in C++?

Farhan Muhamed

Farhan Muhamed

Updated on 06-Jun-2025 18:57:32

544 Views

Enum is a user-defined datatype in C++ that is used to assign names to integer values. For example, you can use an enum to represent the days of the week from 0 to 6, where 0 represents Sunday, 1 represents Monday, and so on. When you try to access a ... Read More

lldiv() function in C++ STL

Farhan Muhamed

Farhan Muhamed

Updated on 06-Jun-2025 18:56:54

151 Views

The lldiv() function is used to perform division operation on long long integers and return both quotient and remainder. In this article, we will learn how to use the lldiv() function from the Standard Template Library (STL) in C++. What is lldiv()? The lldiv() is a in-built function in ... Read More

Insertion and Deletion in STL Set C++

Farhan Muhamed

Farhan Muhamed

Updated on 04-Jun-2025 18:48:48

1K+ Views

The STL set is a container that stores unique elements in a sorted order. Insertions and deletions are common operations performed in containers like std::set and std::vector. In this article, we will learn how to insert and delete elements in a C++ STL set. Insertion in STL Set To ... Read More

How to convert std::string to lower case in C++?

Farhan Muhamed

Farhan Muhamed

Updated on 04-Jun-2025 18:48:16

9K+ Views

The STL library in C++ provides various inbuilt functions and methods to manipulate strings, such as converting them to lower case or upper case. In this article, we will learn all the approaches to convert a std::string to lower case in C++. First of all, let's understand the problem statement. ... Read More

C++ Program to Implement String Matching Using Vectors

Farhan Muhamed

Farhan Muhamed

Updated on 04-Jun-2025 16:25:31

624 Views

In C++, we can create vectors easily using the standard library. We are taking the main string and the string that will be searched as a vector, then searching it into the main string. When one match is found the function returns the address, and removes it from the main ... Read More

How to remove an item from a C++ STL vector with a certain value?

Farhan Muhamed

Farhan Muhamed

Updated on 03-Jun-2025 17:49:46

735 Views

To remove an item from a C++ STL vectors by value, you can use the std::remove inside the argument of erase method of the vector. There are some other methods as well. In this article, we will learn all the approaches to remove an item from a C++ STL vector. ... Read More

Previous 1 ... 5 6 7 8 9 ... 15 Next
Advertisements