0% found this document useful (0 votes)
4 views11 pages

Data Types Aashi Rana

The document provides an overview of data types in C programming, explaining their significance in determining the type and size of data for variables. It categorizes data types into primitive, derived, and user-defined types, detailing examples such as integers, floats, arrays, and structures. Understanding these data types is essential for writing accurate and efficient C code.

Uploaded by

aashirana222
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views11 pages

Data Types Aashi Rana

The document provides an overview of data types in C programming, explaining their significance in determining the type and size of data for variables. It categorizes data types into primitive, derived, and user-defined types, detailing examples such as integers, floats, arrays, and structures. Understanding these data types is essential for writing accurate and efficient C code.

Uploaded by

aashirana222
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 11

PROGRAMM

ING
IN C
Aashi Rana
Sap id –
590016572
Batch – 45
st
DATA TYPE
In C programming, data types are declarations for
variables. This determines the type and size of data
associated with variables

A Data type is a classification that specifies the type


of data a variable can hold, such as integer, floating-
point number, character, or string. It determines the
size and format of the data in memory, as well as
the set of operations that can be performed on it.
TYPE OF DATA TYPE

Primitive data types are the most basic data types that
Primitive are used for representing simple values such as
integers, float, characters, etc.

The data types that are derived from the


Derived primitive or built-in datatypes are referred to as
Derived Data Types

User Defined The user-defined data types are


defined by the user himself
PRIMITIVE DATA TYPE

Interger Float
The integer datatype In C programming
in C is used to store float data type is
the integer numbers used to store
(any number floating-point values
including positive,
negative and zero
without decimal part)
Character Void
Character data type The void data type in
allows its variable to C is used to specify
store only a single that no value is
character present

Note : There are various format specifiers for all this data type
If you need to store small
integer values (within the
range of a char) and want
to save memory, using
a char can be efficient
DERIVED DATA TYPE
In C, the data types derived from the
primitive or built-in data types are
called Derived Data Types. In other
words, the derived data types are those
data types that are created by
combining primitive data types and
other derived data types
DERIVED DATA TYPE

Function Array Pointers

A function is called a Array in C is a fixed- A pointer in C language is


C language construct size collection of a data type that stores the
which consists of a similar data items address where data is
function-body stored in contiguous stored. Pointers store
associated with a memory locations memory addresses of
function-name. variables, functions, and
even other pointers
USER DEFINED DATA TYPE
The data types defined by the user
themself are referred to as user-defined
data types. These data types are derived
from the existing datatypes
used to
redefine the
USER DEFINED DATA TYPE existing data
type names.
Unions are similar to Basically, it is
structures in many
ways , stored in the
used to
same memory provide new
location resulting in names to the
Structure only one member
containing data at
Enumeration existing data
the same time types

Structures are used It allows the user


to create custom
to group items of Union data types with a Typedef
different types into
a single type. The set of named
"struct" keyword is integer constants
used to define a
structure.
Understanding data types is crucial for effective C
programming. By choosing the appropriate data
type, you can ensure your code is accurate,
efficient, and readable. Remember to consider the
purpose, range, precision, and memory usage when
selecting a data type.

You might also like