Data types
 

Introduction
Data types are essential to any computer programming language.

Different languages have different data types that they provide. I

Numbers
In most languages, numbers are either integers or floating points. The number 320 is an integer, as is -125. The number 27.1 is a floating point number, as is -34.2.

The larger the range of numbers needing to be represented, the larger the (fixed) data storage requirement will be. Subsequently, and because memory and other storage has traditionally been limited, computer programming languages also provide different sizes of numbers:

Short : Small integer ranges
Long : Large integer ranges
Float : Small floating point ranges
Double : Large floating point ranges

Characters & Strings
A character value is usually one byte of ASCII, but other character sets (EBCDIC, for example) may change this. It is not usual for a programming language to deal directly with strings (sequences of characters), and usually a scalar variable (array), or pointer to a memory block of a known size will need to be declared.

Pointers
A pointer is a reference to a piece of memory, whether that be 'raw' memory, or formatted according to another data type, or a piece of executable code, such as a function

Pointers can be used to store arrays (like strings of characters), or as a reference to s static single value.

(c) Shilpa Sayura Foundation 2006-2017