Primitive Data Type - Overview

Overview

The actual range of primitive data types that is available is dependent upon the specific programming language that is being used. For example, in C, strings are a composite but built-in data type, whereas in modern dialects of BASIC and in JavaScript, they are assimilated to a primitive data type that is both basic and built-in.

Classic basic primitive types may include:

  • Character (character, char);
  • Integer (integer, int, short, long, byte) with a variety of precisions;
  • Floating-point number (float, double, real, double precision);
  • Fixed-point number (fixed) with a variety of precisions and a programmer-selected scale.
  • Boolean, logical values true and false.
  • Reference (also called a pointer or handle), a small value referring to another object's address in memory, possibly a much larger one.

More sophisticated types which can be built-in include:

  • Tuples in ML, Python
  • Linked lists in Lisp
  • Complex numbers in Fortran, C (C99), Lisp, Python, Perl 6, D
  • Rational numbers in Lisp, Perl 6
  • Hash tables in various guises, in Lisp, Perl, Python, Lua, D
  • First-class functions, closures, continuations in languages that support functional programming such as Lisp, ML, Perl 6, D and C# 3.0

Read more about this topic:  Primitive Data Type