
- C++ Basics
- C++ Home
- C++ Overview
- C++ Environment Setup
- C++ Basic Syntax
- C++ Comments
- C++ Data Types
- C++ Variable Types
- C++ Variable Scope
- C++ Constants/Literals
- C++ Modifier Types
- C++ Storage Classes
- C++ Operators
- C++ Loop Types
- C++ Decision Making
- C++ Functions
- C++ Numbers
- C++ Arrays
- C++ Strings
- C++ Pointers
- C++ References
- C++ Date & Time
- C++ Basic Input/Output
- C++ Data Structures
- C++ Object Oriented
- C++ Classes & Objects
- C++ Inheritance
- C++ Overloading
- C++ Polymorphism
- C++ Abstraction
- C++ Encapsulation
- C++ Interfaces
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.
- Related Articles
- What are access specifiers in C#.NET?
- What are the different access specifiers in C#.NET?
- What are different format specifiers used in C language?
- What are the differences between protected and default access specifiers in Java?
- What are the differences between public, protected and private access specifiers in C#?
- Format specifiers in C
- Space format specifiers in Java
- What are type qualifiers in C++?
- What are type guards in typescript?
- What are primitive data type in C++?
- What are implicit type conversions in C#?
- What are explicit type conversions in C#?
- Add grouping specifiers for large numbers in Java
- The "E" and "e" custom specifiers in C#
- What are fits and what are the type of fits in metrology?

Advertisements