SlideShare a Scribd company logo
What is non primitive data type?
structure
array
union
pointer
Non-primitive or derived data types simply means it is
derived from the available source, we have some primitive
data types in C like int, char, float.
When we make some more variables using these primary
variable that does some different task or specific task is called
as derived data type or non–primitive data type.
Types of Non- primitive data type :
1. Array
2. Structure
3. Union
4. Pointer
Array
It is a continuous memory storage of same data type, homogeneous
storage.
0
a[0]
1
a[1]
2
a[2]
3
a[3]
4
a[4]
5
a[5]
6
a[6]
7
a[7]
8
a[8]
Syntax : data_type variable[size]; Example : int a[9];
Structure
It is a special data type in which we can store different types of variables
under same name. Uses keyword struct to declare.
Syntax : struct name
{
Member variable1;
Member variable2;
} struct_variable;
Example: struct employee
{
int id;
char name[10];
float salary;
} emp1;
Union
It uses keyword union, it can store different type of variables under same
storage. The size of union will be the maximum size of the variable in it.
Syntax : union name
{
Member variable1;
Member variable2;
} union_variable;
Example: union test
{
int x;
char name[10];
float salary;
} data1;
Pointer
It is a variable used to store address of another variable, it uses an
indirection operator(*). It is a powerful concept of C, it is used further in
link lists.
Example:
int a=10;
int *ptr=&a;
a=10
Hf23
Hf23
ptr
FF43
ptr address of a = Hf23 *ptr value of a = 10

More Related Content

PPTX
Pointer in c
PPTX
Data Types - Premetive and Non Premetive
PPTX
Structure in c language
PPTX
PPTX
Turing machine and Halting Introduction
PPTX
C programing -Structure
PPTX
data types in C programming
PPT
Array in c
Pointer in c
Data Types - Premetive and Non Premetive
Structure in c language
Turing machine and Halting Introduction
C programing -Structure
data types in C programming
Array in c

What's hot (20)

PPTX
Concept Of C++ Data Types
 
PPT
Operation on string presentation
PPTX
Control unit
PPT
I/O System
PPTX
Array Introduction One-dimensional array Multidimensional array
PPTX
PPTX
Presentation on pointer.
PPT
Network cable
PPTX
Data Structures - Lecture 9 [Stack & Queue using Linked List]
PPTX
Data types in C
PPTX
Algorithm analysis in fundamentals of data structure
PPTX
Computer Organization and Architecture.pptx
PPTX
C# Delegates
PPTX
C Programming Unit-4
PDF
Classification of computer networks
PPT
Data Encoding
PPT
Algo>Abstract data type
PPTX
Application of Stack For Expression Evaluation by Prakash Zodge DSY 41.pptx
PPTX
Data structure power point presentation
PPTX
Array in c
Concept Of C++ Data Types
 
Operation on string presentation
Control unit
I/O System
Array Introduction One-dimensional array Multidimensional array
Presentation on pointer.
Network cable
Data Structures - Lecture 9 [Stack & Queue using Linked List]
Data types in C
Algorithm analysis in fundamentals of data structure
Computer Organization and Architecture.pptx
C# Delegates
C Programming Unit-4
Classification of computer networks
Data Encoding
Algo>Abstract data type
Application of Stack For Expression Evaluation by Prakash Zodge DSY 41.pptx
Data structure power point presentation
Array in c
Ad

Similar to What is Non-primitive data type? (20)

PPTX
Ganesh C-programming full detailed pptpptx
PPTX
DATA TYPES IN C Language.pptx
PPTX
Data Types in C++-Primary or Built-in or Fundamental data type Derived data t...
PPSX
Data type
PPTX
Fundamental of C Programming (Data Types)
PPTX
17 structure-and-union
PPTX
Data Structure Introduction for Beginners
PPTX
Dats Structures
PPTX
Data structures and algorithm
PPTX
8.derived data types
PPTX
Introduction to data structure presentation
PPTX
Data Structures - Primitives and Non-Primitives
PPTX
Data Structures and Algorithms_Updated.pptx
PPTX
DataStructurePpt.pptx
PDF
Data Structure Ppt for our engineering college industrial training.
PPTX
ntroduction of Algorithms, Analysing Algorithms. Arrays: Sparse Matrices - Re...
PPT
Unit4 C
PPT
ARRAYS IN C++ CBSE AND STATE +2 COMPUTER SCIENCE
PDF
Chapter 7 (Part I) - User Defined Datatypes.pdf
Ganesh C-programming full detailed pptpptx
DATA TYPES IN C Language.pptx
Data Types in C++-Primary or Built-in or Fundamental data type Derived data t...
Data type
Fundamental of C Programming (Data Types)
17 structure-and-union
Data Structure Introduction for Beginners
Dats Structures
Data structures and algorithm
8.derived data types
Introduction to data structure presentation
Data Structures - Primitives and Non-Primitives
Data Structures and Algorithms_Updated.pptx
DataStructurePpt.pptx
Data Structure Ppt for our engineering college industrial training.
ntroduction of Algorithms, Analysing Algorithms. Arrays: Sparse Matrices - Re...
Unit4 C
ARRAYS IN C++ CBSE AND STATE +2 COMPUTER SCIENCE
Chapter 7 (Part I) - User Defined Datatypes.pdf
Ad

More from AnuragSrivastava272 (13)

PPTX
What is recursion?
PPTX
What is Do while loop?
PPTX
What is while loop?
PPTX
What is loops? What is For loop?
PPTX
What is Switch Case?
PPTX
What are conditional statements?
PPTX
What are operators?
PPTX
What is Data Types and Functions?
PPTX
What is Variables and Header files
PPTX
What is IDE?
PPTX
What is Platform Dependency?
PPTX
What is Computer Language?
PPTX
What is Language?
What is recursion?
What is Do while loop?
What is while loop?
What is loops? What is For loop?
What is Switch Case?
What are conditional statements?
What are operators?
What is Data Types and Functions?
What is Variables and Header files
What is IDE?
What is Platform Dependency?
What is Computer Language?
What is Language?

Recently uploaded (20)

PPTX
master seminar digital applications in india
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PPTX
Cell Structure & Organelles in detailed.
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
VCE English Exam - Section C Student Revision Booklet
PDF
Complications of Minimal Access Surgery at WLH
PDF
Pre independence Education in Inndia.pdf
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PDF
Sports Quiz easy sports quiz sports quiz
PPTX
Pharma ospi slides which help in ospi learning
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
O7-L3 Supply Chain Operations - ICLT Program
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PDF
Basic Mud Logging Guide for educational purpose
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PDF
TR - Agricultural Crops Production NC III.pdf
PDF
Insiders guide to clinical Medicine.pdf
master seminar digital applications in india
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
Cell Structure & Organelles in detailed.
STATICS OF THE RIGID BODIES Hibbelers.pdf
O5-L3 Freight Transport Ops (International) V1.pdf
VCE English Exam - Section C Student Revision Booklet
Complications of Minimal Access Surgery at WLH
Pre independence Education in Inndia.pdf
Renaissance Architecture: A Journey from Faith to Humanism
Sports Quiz easy sports quiz sports quiz
Pharma ospi slides which help in ospi learning
Microbial diseases, their pathogenesis and prophylaxis
O7-L3 Supply Chain Operations - ICLT Program
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
Basic Mud Logging Guide for educational purpose
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
TR - Agricultural Crops Production NC III.pdf
Insiders guide to clinical Medicine.pdf

What is Non-primitive data type?

  • 1. What is non primitive data type? structure array union pointer
  • 2. Non-primitive or derived data types simply means it is derived from the available source, we have some primitive data types in C like int, char, float. When we make some more variables using these primary variable that does some different task or specific task is called as derived data type or non–primitive data type.
  • 3. Types of Non- primitive data type : 1. Array 2. Structure 3. Union 4. Pointer
  • 4. Array It is a continuous memory storage of same data type, homogeneous storage. 0 a[0] 1 a[1] 2 a[2] 3 a[3] 4 a[4] 5 a[5] 6 a[6] 7 a[7] 8 a[8] Syntax : data_type variable[size]; Example : int a[9];
  • 5. Structure It is a special data type in which we can store different types of variables under same name. Uses keyword struct to declare. Syntax : struct name { Member variable1; Member variable2; } struct_variable; Example: struct employee { int id; char name[10]; float salary; } emp1;
  • 6. Union It uses keyword union, it can store different type of variables under same storage. The size of union will be the maximum size of the variable in it. Syntax : union name { Member variable1; Member variable2; } union_variable; Example: union test { int x; char name[10]; float salary; } data1;
  • 7. Pointer It is a variable used to store address of another variable, it uses an indirection operator(*). It is a powerful concept of C, it is used further in link lists. Example: int a=10; int *ptr=&a; a=10 Hf23 Hf23 ptr FF43 ptr address of a = Hf23 *ptr value of a = 10