Data Types in C

data-typas-in-c

INTEGER TYPES IN C

  • C supports different kinds of integers
  • maxima and minima defined in “limit.h”

limits.h

This is the second standard header file we have met. This contains the difinition of a number of constants giving the maximum and minimum sizes of the various kinds of integers. It is a text file and may be viewed with any text editor.

concept-of-c-data-types

Constants:

  • Constants have many types in C.
  • Numbers containing “.” or “e” are double: 3.5, 1e-7, -1.29e15.
  • For float constants append “F”: 3.5F, 1e-7F.
  • For long double constants append “L”: -1.29e15L, 1e-7L.
  • Numbers without “.” “e” or “F” are int, e.g.10000, -35 (some compilers switch to long “int” if the constant would overflow “int”).
  • For “long int” constants append “L”, e.g. 9000000L.

 

Related posts