JavaClassCode.com

facebook twitter googleplus

C Tutorial

C Introduction C Installation C Keywords and Identifier C Variables C Constants C Data Types C Input/Output C Operators C Introduction Examples

C Control Flow

C if...else C for loop C while loop C break and continue C switch case C goto Control Flow Examples

C Functions

C Function C User-define Function C Function Types C Recursion C Storage Class C Function Examples

C Pointers

C Pointers C Pointers & Arrays C Pointers and Functions C Memory Allocation Array and Pointer Examples

C Strings

C Strings C String Functions C String Examples

Structure and Union

C Structure C Struct and Pointers C Struct and Function C Unions C Struct Examples

C Programming Files

C Files Input/Output C Files Examples

Additional Topics

C Enumeration C Preprocessors C Standard Library C Programming Examples

C Data Types


C data types are defined as the data storage format that a variable can store a data to perform a specific operation. Data types are used to define a variable before to use in a program. Each data type requires different amounts of memory and has some specific operations which can be performed over it.

Different data types also have different ranges upto which they can store numbers. These ranges may vary from compiler to compiler.

C language supports two different type of data types:

  1. Primary data types
  2. Derived data types

Primary data types

These are fundamental data types in C namely integer(int), floating point(float), character(char) and void.

Data type determines the type of data a variable will hold. If a variable x is declared as int. it means x can hold only integer values.

Every variable which is used in the program must be declared as what data-type it is.

Derived data types

Derived data types are nothing but primary datatypes but a little twisted or grouped together like array, stucture, union and pointer. These data types are are discussed at later tutorial in details.