Computer Science, asked by rabitabrahma08210821, 4 months ago

Explain c++ data types with appropriate example​

Answers

Answered by abiminnu02
2

Answer:

A data type determines the type and the operations that can be performed on the data. C++ provides various data types and each data type is represented differently within the computer’s memory. The various data types provided by C++ are built-in data types, derived data types and user-defined data types

Built-In Data Types

The basic (fundamental) data types provided by c++ are integral, floating point and void data type. Among these data types, the integral and floating-point data types can be preceded by several type modifiers. These modifiers (also known as type qualifiers) are the keywords that alter either size or range or both of the data types. The various modifiers are short, long, signed and unsigned. By default the modifier is signed.

In addition to these basic data types, ANSI C++ has introduced two more data types namely, bool and wchar_t.

Integral Data Type: The integral data type is used to store integers and includes char (character) and int (integer) data types.

Char: Characters refer to the alphabet, numbers and other characters (such as {, @, #, etc.) defined in the ASCII character set. In C++, the char data type is also treated as an integer data type as the characters are internally stored as integers that range in value from -128 to 127. The char data type occupies 1 byte of memory (that is, it holds only one character at a time).

Explanation:

Similar questions