×
Home Discussions Write at Opengenus IQ
×
  • DSA Cheatsheet
  • HOME
  • Track your progress
  • Deep Learning (FREE)
  • Join our Internship 🎓
  • RANDOM
  • One Liner

C++

C++ is a powerful, object oriented and early programming language which is derived from C. It is widely used in production systems and gives huge control to the programmer.

C++

Dot Product of Two Vectors in C++

In this article, we have presented two different ways to do Dot Product of Two Vectors in C++. This involves the use of inner_product method in C++ STL (Standard Template Library).

Mainak Debnath
C++

"using namespace std;" is bad practice in C++

The statement "using namespace std;" is generally considered bad practice. The alternative to this statement is to specify the namespace to which the identifier belongs using the scope operator(::) each time we declare a type.

Shwet Shukla Shwet Shukla
Software Engineering

Power and Exponential functions in math.h Header file in C/ C++

In a simple way, a Library is collection of built in functions. One of the header file of standard C library is "math.h". As the name itself suggests, It defines various mathematical functions.

Sanjay kumar
C++

Different ways to initialize Deque in C++ STL

In this article, we will learn about the concept behind a deque and different ways to initialize a deque in C++ Standard Template Library (STL) like using default constructor, fill, range, move and others.

TJ Kapil
C++

Different Ways to find element in Vector in C++ STL

In this article, we have explained Different Ways to find element in Vector in C++ STL which includes using std::find(), std::find_if, std::distance, std::count and Linear Search.

Erick Lumunge
C++

std::swap function in C++

In this article, we have explained the use of std::swap function in C++ with multiple C++ code examples covering primitive data types to User defined classes.

Shambhavi Sudarsan Shambhavi Sudarsan
Software Engineering

Scope Resolution :: in C++

In this article, we have explored the idea of Scope Resolution operator :: in C++ which is used widely in C++ implementations to access a class inside another class, in multiple inheritance and many more.

Kirti Singh
C++

Size of 2D vector in C++

In this article, we will learn how to get size of 2D vector in C++. This topic has a wide applications such as in graphs, or even in machine learning. Getting used to handling 2D vectors in C++ helps us approach our problems easier.

Linh Vu
Software Engineering

Vector of Pair in C++

We have covered the idea of Vector of Pair in C++ with code examples along with basics of Pair and vector in C++.

Anubhav Tewari
Software Engineering

malloc in C++

malloc is a C++ library function that allocates the requested memory and returns a pointer to it. This is called dynamic memory allocation and allows for memory allocation on the go. It is the predecessor to the C++ new operator used for memory allocation.

Oluwasheun Oluwasheun
Software Engineering

Different Preprocessor Directives in C / C++

We have explained the Different Preprocessor Directives in C / C++ along with C++ code examples. Preprocessor Directives are processed at compile time and is an important programming technique in large codebase.

Abhayanandan Panicker
Software Engineering

Types of classes in C++

An important aspect of Object-oriented programming is the usage of classes and objects. We have covered different types of classes in C++ such as Standalone classes, Abstract base class, Concrete Derived Class and much more.

Rohan Chandrashekar Rohan Chandrashekar
Software Engineering

__builtin_popcount and POPCNT

We have explored about __builtin_popcount - a built-in function of GCC, which helps us to count the number of 1's(set bits) in an integer in C and C++. POPCNT is the assembly instruction used in __builtin_popcount.

Aditya L Rao
Software Engineering

Structure (struct) in C [Complete Guide]

A structure is defined as a collection of same/different data types. All data items thus grouped logically related and can be accessed using variables.

AASHISH
Software Engineering

Size of struct in C/ C++

We have explained how to calculate the memory size of a struct in C and C++ Programming Language. To find the actual size, you need to understand two concepts of padding and packing. The size is not the sum of individual elements so read on.

Abhishek Singh
Software Engineering

calloc() in C / C++

We have explained the use of calloc() function in C / C++ which is used for Dynamic Memory Allocation. We have explained it with code examples with different situations.

Satvik Singh
C++

Static and extern pointers in C/ C++

Static and extern are storage classes in C which defines scope and life-time of a variable. Similar to any variables in C, we can use these keywords with pointers for different use cases.

Aditya L Rao
Software Engineering

2D list in C++ STL (Defining and Sorting)

In this article, we will begin with a brief recap of what lists are, followed by an introduction to 2-dimensional lists (2D list), where we shall explore creating and defining 2D lists in C++ STL and sorting them.

J. Varun Iyer J. Varun Iyer
Software Engineering

Dynamic Memory Allocation in C++

Dynamic Memory Allocation in C++ is the process of allocating memory while a program is running or at run time rather than at compile time. C++ uses new and delete operator for dynamic allocation and freeing up of memory.

Naveen Singla
Software Engineering

2D arrays in C++ (2 ways)

We have discussed what are 2 Dimensional (2D) arrays and what are the different ways we can initialize them and how we can use them in C++.

Adith Narein T Adith Narein T
Software Engineering

Struct vs Class in C++

We have covered the points of differences between struct and class in C++ with code examples. We have cleared the misconceptions about struct in C language and class in C++.

Yatharth Agarwal
Software Engineering

Passing a vector to a function in C++

In this article, we have covered how to pass a vector to a function as function argument in C++ with variants like 1D vector, 2D vector, 3D vector, global vector and global vector by value. We have also, covered how to return a vector from a function.

Umesh
Software Engineering

Abstraction in C++ [Explained]

In this article, we have explained Abstraction in C++ in depth with different types of abstraction and C++ code examples.

Jahanvi Sharma
Software Engineering

qsort: Sorting using stdlib.h in C [Explained with examples]

In this article, we have explained how to use qsort that is Sorting using stdlib.h in C. We have presented the use-case using code examples.

Vishwajith K
Software Engineering

Fixed width integer types (int8) in C++

C99 has defined a set of fixed-width integers that are guaranteed to have the same size on any architecture. These can be found in stdint.h header. This enables to use INT8 in C++.

Aditya Kumar Saroj
OpenGenus IQ © 2025 All rights reserved â„¢
Contact - Email: team@opengenus.org
Primary Address: JR Shinjuku Miraina Tower, Tokyo, Shinjuku 160-0022, JP
Office #2: Commercial Complex D4, Delhi, Delhi 110017, IN
Top Posts LinkedIn Twitter
Android App
Apply for Internship