×
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.

Software Engineering

Different ways to initialize a queue in C++ STL

In this article, we have explored different ways to initialize a queue in C++ Standard Template Library (STL). There are three ways to initialize Member functions for inserting elements, Container objects and another Queue.

Tushti
Software Engineering

Defining a 2D vector in C++

In this article, we have explored the different ways of defining a 2D vector in C++

Raghav Somani
Software Engineering

delete vs delete[] vs free in C++

In this article, we will explore the difference between delete, delete[], free keywords of C++ which are often confused with each other and sometimes wrongly used leading to the errors in one's program.

Rasika Kedia
Software Engineering

Destructors in C++

A destructor in C++ is a member function associated with each class and is called when the scope of the object of the classes is over to delete all data allocated for the object.

Peya Mowar
Software Engineering

Everything about Constructors in C++

A constructor is a special member function which enables the object of a class to initialize itself when it is created. We have explored different types of constructors, constructor overloading and constructor with default arguments.

Ruchika Goel
Software Engineering

Call by Value vs Call by Reference in C++

'Call' refers to calling a function. Both of these (Call by Value and Call by Reference) are methods of function invocation. The difference, lies in formal parameters

Priyanshi Sharma Priyanshi Sharma
Software Engineering

Reference vs Pointer in C++

In this article, we have explained the difference between reference and pointer in C++ in detail. In short, reference is an alternative name for a variable while pointer is a variable that contains memory address of another variable.

Priyanshi Sharma Priyanshi Sharma
Software Engineering

goto statement in C++

In C++, the goto statement is a jump statement used to transfer unconditional control to a specified label. In other words, it allows you to jump from any starting point to any ending point in a program, altering the program's flow.

Arushi Gupta
Software Engineering

Assignment operator = in C++

In C++ language, the assignment operator '=' is used to assign a value to a variable. It is a binary operator and has lower precedence than other operators except comma operator. We have explored this in depth.

Subhash Bhandari
Software Engineering

Put array in register in C/ C++

Placing an array in a register can improve performance significantly but only statically allocated array can be placed in a register explicitly as we cannot deal with memory location directly. We have explained this in detail.

OpenGenus Tech Review Team OpenGenus Tech Review Team
Software Engineering

Variadic function in C/ C++

Variadic functions in C and C++ are the functions that can take any number of arguments. This is a central part of utilities like printf. We have explained this in detail with examples.

Khitish Panigrahi Khitish Panigrahi
Software Engineering

Rounding Functions in C / C++

In this article, we have focused on different rounding functions in C and C++ such as floor, ceil, round, trunc and fmod. We have explained each in detail with C++ code examples.

Ankit Rustagi Ankit Rustagi
Software Engineering

Chrono Library in C++

Chrono library is also used to measure time elapsed during execution of a C++ program. It can measure the time in seconds, milliseconds , micro seconds and nano seconds.

Khitish Panigrahi Khitish Panigrahi
Software Engineering

Writing to a File in C++

In this article, we have explored the way to write to a file in C++ in depth and explored opening and closing a file, appending data to the front of a file and appending data to end of a file (default).

Yash Kedia Yash Kedia
Software Engineering

Hyperbolic functions in math.h (C/C++)

In this article, we have explored all hyperbolic functions in math.h library of C and C++ with code examples. It includes functions like Complex Hyperbolic Cosine (cosh), Inverse Hyperbolic Cosine (acosh), Complex Inverse Hyperbolic Cosine (cacosh) and other variants for sin and tangent.

Jyothirmai Thimmaraju Jyothirmai Thimmaraju
Software Engineering

Array in C++ Standard Template Library (STL)

Array is a container in C++ STL which are used to store homogeneous (same) type of data and provides several useful functionalities over it. It is a static array.

Uday Bhardwaj
Software Engineering

Measure time in C++

In this article at OpenGenus, we explored different methods to measure time in C++ which includes time(), clock() and chrono library. This can be used to measure program execution time as well.

Prateek Sharma
Software Engineering

chdir(), fchdir() and getcwd() in C

chdir() and fchdir() are functions in C listed in unistd.h header file which is used to change the current working directory through code. This can be verified by getcwd() function.

Devansh Thapa Devansh Thapa
Software Engineering

push() in Stack C++ STL

We have discussed about how we can insert elements in stack container using push() method provided by C++ STL(Standard Template Library).

Gauhar Ayub Khan Gauhar Ayub Khan
Software Engineering

Add strings in C++

There are multiple ways to add two or more strings or a string and an integer in C++. We will explore each method is depth but the easiest approach is to use + operator and the format() method in C++20.

OpenGenus Tech Review Team OpenGenus Tech Review Team
Software Engineering

Sorting a vector in C++

A vector in C++ can be sorted in multiple ways like ascending or descending order, using a custom comparison function, using lambda, sorting a 2D matrix and using nth_element() function.

K. Sai Drishya K. Sai Drishya
Software Engineering

Understand use of Pointers (*) in C and C++

A pointer in C and C++ is a variable that contains a memory address which is usually the address/ location of another variable in the memory.

Ishneet Kaur Ahuja
Software Engineering

Get length of array in C and C++

In C and C++, we find the length of an array we need to use the sizeof operator and get the length as size of entire array divided by size of an element.

OpenGenus Tech Review Team OpenGenus Tech Review Team
Software Engineering

Hashing in C++ using std::hash

In this article, we will cover how hashing is natively supported in C++ through STL (std:hash) and how we can use it to generate hash of any object in C++.

Sourajeet Mohanty Sourajeet Mohanty
Software Engineering

How to ban use of some functions in C and C++?

The approach to prevent the use of functions is to replace the function definition (using macros) with a dummy definition with a message that the function is banned from use.

OpenGenus Tech Review Team OpenGenus Tech Review Team
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