What are Type Specifiers in C++



When you first declare a variable in a statically typed language such as C++ you must declare what that variable is going to hold.

int number = 42;

In that example, the "int" is a type specifier stating that the variable "number" can only hold integer numbers. In dynamically typed languages such as ruby or javascript, you can simply declare the variable.

var number = 42;

There are a lot of built-in type specifiers like double, char, float, etc in C++. You can also create your own specifiers by creating class and structs.


Updated on: 2020-02-10T12:22:21+05:30

3K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements