Revathi Satya Kondra has Published 72 Articles

Type Inference in C++

Revathi Satya Kondra

Revathi Satya Kondra

Updated on 22-Apr-2025 19:11:49

354 Views

Type inference (or, type deduction) refers to the automatic detection of the data type of an expression in a programming language. In C++, the auto keyword is used for automatic type deduction.For example, you want to create an iterator to iterate over a vector, you can simply use auto for ... Read More

Copy-and-Swap Idiom in C++

Revathi Satya Kondra

Revathi Satya Kondra

Updated on 22-Apr-2025 19:08:35

289 Views

The Copy and Swap Idiom in C++ is a technique used in assignment operations. This consists of two steps: Discarding an object's old state and building a new state for it. The destructor is used for the first step and a copy constructor does the second step. Implementing both of ... Read More

Can namespaces be nested in C++?

Revathi Satya Kondra

Revathi Satya Kondra

Updated on 21-Apr-2025 19:24:03

209 Views

Yes, the namespace can be nested in C++. We can define one namespace inside another namespace. This makes it easier for developers to design a more structured and hierarchical format for their code. Syntax The following is the syntax as below : namespace namespace_name1 { ... Read More

Pointers vs References in C++

Revathi Satya Kondra

Revathi Satya Kondra

Updated on 21-Apr-2025 19:23:35

9K+ Views

In C++, both pointers and references are used to access and manipulate memory. But they behave differently. This guide explains each with simple words and examples. We understand the topic by learning how each is declared, used, and what differences exist between them. What are C++ Pointers? The pointers are ... Read More

What is a reference variable in C++?

Revathi Satya Kondra

Revathi Satya Kondra

Updated on 21-Apr-2025 19:22:04

22K+ Views

In C++, the reference variable is an alternate name of already existing variable. It cannot be changed to refer another variable and should be initialized at the time of declaration and cannot be NULL. The operator '&' is used to declare reference variable. Reference variables are commonly used for parameter ... Read More

C++ Program to Implement Sorted Array

Revathi Satya Kondra

Revathi Satya Kondra

Updated on 21-Apr-2025 18:23:50

29K+ Views

In C++, arranging the elements in increasing or decreasing order is called as Sorting. we usually use the sort() function from the STL (Standard Template Library). A sorted array is an array whose each of the elements are sorted in some order such as numerical, alphabetical etc. There are many ... Read More

Strand sort in C++

Revathi Satya Kondra

Revathi Satya Kondra

Updated on 21-Apr-2025 18:17:18

320 Views

In C++, the strand sort is a recursive sorting algorithm. It is used to extract increasing subsequences repeatedly (called strands) from the input list and merge them into a sorted list. There are multiple libraries that can be used for different purposes. This sorting is one of them. This sorting ... Read More

Passing by pointer Vs Passing by Reference in C++

Revathi Satya Kondra

Revathi Satya Kondra

Updated on 17-Apr-2025 18:40:27

3K+ Views

In C++, If we want to pass arguments to functions we can either pass the actual value, a pointer to the value, or a reference to the value. This concept becomes crucial when we want a function to modify the original variable. So, if we pass parameter to a function ... Read More

Execute both if and else statements in C/C++ simultaneously

Revathi Satya Kondra

Revathi Satya Kondra

Updated on 17-Apr-2025 18:39:52

341 Views

In this article, we will see how to execute the if and else section simultaneously in a C or C++, code. This solution is a little bit tricky. When the if and else are executed one after another then it is like executing statements where if-else are not present. But ... Read More

How does #include work in C++?

Revathi Satya Kondra

Revathi Satya Kondra

Updated on 17-Apr-2025 18:38:17

3K+ Views

In C++, the is a header file. This file includes all standard library. Sometimes in some coding contests, when we have to save time while solving, then using this header file is helpful. In software engineering approach we should reduce the minimize the include. Using this header file, it ... Read More