C++ Math cos() function

In this post today I am going to discuss C++ Math cos() functions. The function is used to determine the cosine of an angle given in terms of a radian. Syntax Of cos() function: Consider a radian ‘x’. The syntax…

Exponential Math Functions In C++

In this post today I am going to explain exponential math functions in C++. Exponential Math Functions: Method Description exp(x) It computes the exponential e raised to the power x. frexp(value_type x,int* exp) It breaks a number into significand and…

Trigonometric Math Functions In C++

In this post today I am going to explain trigonometric math functions in C++. C++ has several fundamental arithmetic functions, and the header file <math.h> is required to use them. Trignometric Functions: Method Description cos(x) It computes the cosine of…

Friend function in C++

In C++, if a function is declared as a friend function, the function can access a class’s protected and private data. The keyword friend informs the compiler that the supplied function is a friend function. The declaration of a friend…

Enum In C++

Enum in C++ is a data type that holds a fixed collection of constants. It may be used to represent days of the week (SUNDAY, MONDAY, TUESDAY, WEDNESDAY, WEDNESDAY, THURSDAY, FRIDAY, and SATURDAY) as well as directions (NORTH, SOUTH, EAST,…

Structs In C++

Classes and structs are blueprints in C++ that are used to construct a class instance. Lightweight objects like rectangles, Colour, and Point are created using struct. In contrast to classes, structs in C++ are of the value type rather than…

Static Keyword In C++

Static Keyword In C++ is also called a modifier that refers to the type rather than the instance. As a result, access to the static members does not need the use of an instance. Field, method, constructor, class, properties, operator,…

What is this Pointer In C++?

In this post, we are going to learn about the use of this keyword and how to apply it? “this” is a keyword in C++ programming that refers to the current instance of the class. In C++, the “this” keyword…

What is Destructor In C++

A destructor is the complete opposite of a constructor, it destroys class objects. It can only be specified once per class. It is called automatically, just like Constructors. A Constructor is what a destructor is. It has to be named after the class. It is, however, preceded with a tilde symbol (~). Destructors in C++ are not allowed to contain arguments. Modifiers can’t be used on destructors, either. #Note C++ Constructor and Destructor Example: Let’s look at an example of a C++ constructor and destructor that is automatically invoked: Output: