SlideShare uma empresa Scribd logo
1 de 17
Prepared by:
Raj Naik
SY CE-1
150410107053
 Data type specifies the type of data stored in a variable.
 Data types in C programming language enables the
programmers to appropriately select the data as per
requirements of the program and the associated
operations of handling it.
 The data type can be classified into two types Primitive
data type and Non-Primitive data type
 The primitive data types are the basic data types that are
available in most of the programming languages.
 The primitive data types are used to represent single values.
 Primitive data are only single values, they have not special
capabilities.
 Data structure that normally are directly operated upon by
machine level instructions are known as primitive structure
and data type.
 Integer(int): This is used to represent a number
without decimal point.
Eg: 12, 90
 Float and Double: This is used to represent a number
with decimal point.
Eg: 45.1, 67.3
 Character : This is used to represent single character
Eg: ‘C’, ‘a’
 Syntax for integer:
int variable_name;
 Syntax for float:
float variable_name;
 Syntax for double:
double variable_name;
 Syntax for chracter:
char variable_name;
Datatype Size(in bytes) Range
Integer
int
signed int
unsigned int
short int
signed short int
unsigned short int
long int
signed long int
unsigned long int
2
2
2
1
1
1
4
4
4
-32,768 to 32,767
-32,768 to 32,767
0 to 65535
-128 to 127
-128 to 127
0 to 255
-2,147,483,648 to
2,147,483,647
Same as Above
0 to 4,294,967,295
Float &
Double
float
double
long double
4
8
10
3.4E-38 to 3.4E+38
1.7E-308 to 1.7E+308
3.4E-4932 to
1.1E+4932
Character
char
signed char
unsigned char
1
1
1
-128 to 127
-128 to 127
0 to 255
 The data types that are derived from primary data types are
known as non-Primitive data types.
 These data types are used to store group of values.
 The non-primitive data types are,
Arrays
Structure
Union
linked list
Stacks
Queue
 An array is used to store a collection of variables of the same
data type.
 A specific element in an array is accessed by an index.
 All arrays consist of contiguous memory locations.
 Syntax for declaring array is,
data type arrayName [ arraySize ];
 Initializing Arrays,
double balance[5] = {1000.0, 2.0, 3.4, 7.0, 50.0};
 The lowest address corresponds to the first element and the
highest address to the last element.
 Structure is another user defined data type available in C
that allows to combine data items of different kinds.
 Structures are used to represent a record.
 To define a structure, we must use the struct statement.
The struct statement defines a new data type, with more
than one member. The format of the struct statement is as
follows −
 struct [structure tag] { member definition; member
definition; ... member definition; } [one or more structure
variables];
 struct Books { char title[50]; char author[50]; char
subject[100]; int book_id; } book;
 A union is a special data type available in C that allows
to store different data types in the same memory
location. We can define a union with many members,
but only one member can contain a value at any given
time. Unions provide an efficient way of using the
same memory location for multiple-purpose.
 To define a union, we must use the union statement
 union [union tag] { member definition; member
definition; ... member definition; } [one or more union
variables];
 Here is the way that we could define a union type
named Data having three members i, f, and str −
 union Data { int i; float f; char str[20]; } data;
 The memory occupied by a union will be large enough
to hold the largest member of the union. For example,
in the above example, Data type will occupy 20 bytes of
memory space because this is the maximum space
which can be occupied by a character string.
 The linked list consists of series of structures. They are
not required to be stored in adjacent memory location.
Each structure consists of a data field and address
field. Address field contains the address of its
successors.
 The actual representation of the structure is as follow:
 A variable of the above structure type is conventionally
known as node.
 Here the representation of a linked list of three nodes:
Node A Node B Node C
Data Address
X1 X2 X3
 Node A stored data X1 and the address of the successor node B.
Node B stores the data X2 and the address of its successor node
C. node C contains the data X3 and its address field is grounded,
indicating it does not have successor.
 There are three types of Linked List:
 Singly Linked List
 Doubly Linked List
 Circular Linked List
 Linked lists are the best and simplest example of a dynamic data
structure that uses pointers for its implementation.
 Items can be added or removed from the middle of the list.
 There is no need to define an initial size.
 Stack can be implemented
using the Linked List or
Array.
 Stack is LIFO Structure [ Last
in First Out ]
 Stack is Ordered List
of Elements of Same Type.
 Stack is Linear List
 In Stack all Operations such
as Insertion and
Deletion are permitted at
only one end called Top
Position of Top Status of Stack
-1 Stack is Empty
0
First Element is
Just Added into
Stack
N-1
Stack is said to
Full
N
Stack is said to
be Overflow
 Queue is a specialized data storage structure (Abstract data
type).
 Arrays access of elements in a Queue is restricted.
 It has two main operations enqueue and dequeue.
 Insertion in a queue is done using enqueue function and
removal from a queue is done using dequeue function.
 An item can be inserted at the end of the queue and
removed from the front of the queue.
 It is therefore, also called First-In-First-Out (FIFO) list.
 Queue has important properties,
 capacity stands for the maximum number of elements Queue
can hold,
 size stands for the current size of the Queue,
 elements is the array of elements,
 It has two basic implementations,
 Array-based implementation – It’s simple and efficient but
the maximum size of the queue is fixed.
 Singly Linked List-based implementation – It’s complicated
but there is no limit
 on the queue size, it is subjected to the available memory.
Thank you…

Mais conteúdo relacionado

Mais procurados

Presentation on array
Presentation on array Presentation on array
Presentation on array topu93
 
Doubly Linked List
Doubly Linked ListDoubly Linked List
Doubly Linked ListNinad Mankar
 
Call by value
Call by valueCall by value
Call by valueDharani G
 
Introduction to data structure
Introduction to data structure Introduction to data structure
Introduction to data structure NUPOORAWSARMOL
 
classes and objects in C++
classes and objects in C++classes and objects in C++
classes and objects in C++HalaiHansaika
 
Introduction to data structures and Algorithm
Introduction to data structures and AlgorithmIntroduction to data structures and Algorithm
Introduction to data structures and AlgorithmDhaval Kaneria
 
Presentation on Function in C Programming
Presentation on Function in C ProgrammingPresentation on Function in C Programming
Presentation on Function in C ProgrammingShuvongkor Barman
 
Class and object in C++
Class and object in C++Class and object in C++
Class and object in C++rprajat007
 
Concept of c data types
Concept of c data typesConcept of c data types
Concept of c data typesManisha Keim
 
Oop c++class(final).ppt
Oop c++class(final).pptOop c++class(final).ppt
Oop c++class(final).pptAlok Kumar
 
FUNCTIONS IN c++ PPT
FUNCTIONS IN c++ PPTFUNCTIONS IN c++ PPT
FUNCTIONS IN c++ PPT03062679929
 
06. operator overloading
06. operator overloading06. operator overloading
06. operator overloadingHaresh Jaiswal
 
Functions in c language
Functions in c language Functions in c language
Functions in c language tanmaymodi4
 

Mais procurados (20)

Presentation on array
Presentation on array Presentation on array
Presentation on array
 
Arrays in Java
Arrays in JavaArrays in Java
Arrays in Java
 
Doubly Linked List
Doubly Linked ListDoubly Linked List
Doubly Linked List
 
C++ Arrays
C++ ArraysC++ Arrays
C++ Arrays
 
sorting and its types
sorting and its typessorting and its types
sorting and its types
 
Call by value
Call by valueCall by value
Call by value
 
Introduction to data structure
Introduction to data structure Introduction to data structure
Introduction to data structure
 
Abstract data types
Abstract data typesAbstract data types
Abstract data types
 
classes and objects in C++
classes and objects in C++classes and objects in C++
classes and objects in C++
 
Introduction to data structures and Algorithm
Introduction to data structures and AlgorithmIntroduction to data structures and Algorithm
Introduction to data structures and Algorithm
 
Presentation on Function in C Programming
Presentation on Function in C ProgrammingPresentation on Function in C Programming
Presentation on Function in C Programming
 
Class and object in C++
Class and object in C++Class and object in C++
Class and object in C++
 
Concept of c data types
Concept of c data typesConcept of c data types
Concept of c data types
 
Strings in C
Strings in CStrings in C
Strings in C
 
Oop c++class(final).ppt
Oop c++class(final).pptOop c++class(final).ppt
Oop c++class(final).ppt
 
FUNCTIONS IN c++ PPT
FUNCTIONS IN c++ PPTFUNCTIONS IN c++ PPT
FUNCTIONS IN c++ PPT
 
06. operator overloading
06. operator overloading06. operator overloading
06. operator overloading
 
Data structures using c
Data structures using cData structures using c
Data structures using c
 
Functions in c language
Functions in c language Functions in c language
Functions in c language
 
Arrays in Java
Arrays in JavaArrays in Java
Arrays in Java
 

Destaque

Difference between dtd and xsd
Difference between dtd and xsdDifference between dtd and xsd
Difference between dtd and xsdUmar Ali
 
Effective business communication
Effective business communicationEffective business communication
Effective business communicationSuzanne Hazelton
 
TCS Job Interview Questions
TCS Job Interview QuestionsTCS Job Interview Questions
TCS Job Interview QuestionsNavdeep Kumar
 
Uml Omg Fundamental Certification 2
Uml Omg Fundamental Certification 2Uml Omg Fundamental Certification 2
Uml Omg Fundamental Certification 2Ricardo Quintero
 
Difference Between Sql - MySql and Oracle
Difference Between Sql - MySql and OracleDifference Between Sql - MySql and Oracle
Difference Between Sql - MySql and OracleSteve Johnson
 
The Graph Traversal Programming Pattern
The Graph Traversal Programming PatternThe Graph Traversal Programming Pattern
The Graph Traversal Programming PatternMarko Rodriguez
 
Relational database management system (rdbms) i
Relational database management system (rdbms) iRelational database management system (rdbms) i
Relational database management system (rdbms) iRavinder Kamboj
 
Introduction of data structure
Introduction of data structureIntroduction of data structure
Introduction of data structureeShikshak
 
Lecture 1 data structures and algorithms
Lecture 1 data structures and algorithmsLecture 1 data structures and algorithms
Lecture 1 data structures and algorithmsAakash deep Singhal
 
Rdbms
RdbmsRdbms
Rdbmsrdbms
 
Voka kempen innovatieacademie 2015 session 6
Voka kempen innovatieacademie 2015 session 6Voka kempen innovatieacademie 2015 session 6
Voka kempen innovatieacademie 2015 session 6Frank Dethier
 

Destaque (20)

Array1
Array1Array1
Array1
 
HDF5 Abstract Data Model
HDF5 Abstract Data ModelHDF5 Abstract Data Model
HDF5 Abstract Data Model
 
Difference between dtd and xsd
Difference between dtd and xsdDifference between dtd and xsd
Difference between dtd and xsd
 
Effective business communication
Effective business communicationEffective business communication
Effective business communication
 
TCS Job Interview Questions
TCS Job Interview QuestionsTCS Job Interview Questions
TCS Job Interview Questions
 
Uml Omg Fundamental Certification 2
Uml Omg Fundamental Certification 2Uml Omg Fundamental Certification 2
Uml Omg Fundamental Certification 2
 
Difference Between Sql - MySql and Oracle
Difference Between Sql - MySql and OracleDifference Between Sql - MySql and Oracle
Difference Between Sql - MySql and Oracle
 
The Graph Traversal Programming Pattern
The Graph Traversal Programming PatternThe Graph Traversal Programming Pattern
The Graph Traversal Programming Pattern
 
Stack a Data Structure
Stack a Data StructureStack a Data Structure
Stack a Data Structure
 
Relational database management system (rdbms) i
Relational database management system (rdbms) iRelational database management system (rdbms) i
Relational database management system (rdbms) i
 
Introduction of data structure
Introduction of data structureIntroduction of data structure
Introduction of data structure
 
RDBMS.ppt
RDBMS.pptRDBMS.ppt
RDBMS.ppt
 
Data Structure
Data StructureData Structure
Data Structure
 
Lecture 1 data structures and algorithms
Lecture 1 data structures and algorithmsLecture 1 data structures and algorithms
Lecture 1 data structures and algorithms
 
Rdbms
RdbmsRdbms
Rdbms
 
Jorge informatica
Jorge informaticaJorge informatica
Jorge informatica
 
Skinput
SkinputSkinput
Skinput
 
Voka kempen innovatieacademie 2015 session 6
Voka kempen innovatieacademie 2015 session 6Voka kempen innovatieacademie 2015 session 6
Voka kempen innovatieacademie 2015 session 6
 
Artesanía ad 15
Artesanía ad 15Artesanía ad 15
Artesanía ad 15
 
Aplicasiones informaticas en la red
Aplicasiones informaticas en la redAplicasiones informaticas en la red
Aplicasiones informaticas en la red
 

Semelhante a C Data Types and Structures Guide

DATA STRUCTURES - SHORT NOTES
DATA STRUCTURES - SHORT NOTESDATA STRUCTURES - SHORT NOTES
DATA STRUCTURES - SHORT NOTESsuthi
 
Concept Of C++ Data Types
Concept Of C++ Data TypesConcept Of C++ Data Types
Concept Of C++ Data Typesk v
 
ARRAYS IN C++ CBSE AND STATE +2 COMPUTER SCIENCE
ARRAYS IN C++ CBSE AND STATE +2 COMPUTER SCIENCEARRAYS IN C++ CBSE AND STATE +2 COMPUTER SCIENCE
ARRAYS IN C++ CBSE AND STATE +2 COMPUTER SCIENCEVenugopalavarma Raja
 
2. Introduction to Data Structure.pdf
2. Introduction to Data Structure.pdf2. Introduction to Data Structure.pdf
2. Introduction to Data Structure.pdfSulabhPawaia
 
data structure programing language in c.ppt
data structure programing language in c.pptdata structure programing language in c.ppt
data structure programing language in c.pptLavkushGupta12
 
DATA STRUCTURE IN C LANGUAGE
DATA STRUCTURE IN C LANGUAGEDATA STRUCTURE IN C LANGUAGE
DATA STRUCTURE IN C LANGUAGEshubhamrohiwal6
 
8074.pdf
8074.pdf8074.pdf
8074.pdfBAna36
 
Data structures introduction
Data structures   introductionData structures   introduction
Data structures introductionmaamir farooq
 
Arrays in Data Structure and Algorithm
Arrays in Data Structure and Algorithm Arrays in Data Structure and Algorithm
Arrays in Data Structure and Algorithm KristinaBorooah
 
Datastructures and algorithms prepared by M.V.Brehmanada Reddy
Datastructures and algorithms prepared by M.V.Brehmanada ReddyDatastructures and algorithms prepared by M.V.Brehmanada Reddy
Datastructures and algorithms prepared by M.V.Brehmanada ReddyMalikireddy Bramhananda Reddy
 
Data structures and algorithms short note (version 14).pd
Data structures and algorithms short note (version 14).pdData structures and algorithms short note (version 14).pd
Data structures and algorithms short note (version 14).pdNimmi Weeraddana
 
data structure details of types and .ppt
data structure details of types and .pptdata structure details of types and .ppt
data structure details of types and .pptpoonamsngr
 
Structures in c language
Structures in c languageStructures in c language
Structures in c languagetanmaymodi4
 
Structures in c language
Structures in c languageStructures in c language
Structures in c languageTanmay Modi
 

Semelhante a C Data Types and Structures Guide (20)

DS_PPT.pptx
DS_PPT.pptxDS_PPT.pptx
DS_PPT.pptx
 
DS_PPT.ppt
DS_PPT.pptDS_PPT.ppt
DS_PPT.ppt
 
DATA STRUCTURES - SHORT NOTES
DATA STRUCTURES - SHORT NOTESDATA STRUCTURES - SHORT NOTES
DATA STRUCTURES - SHORT NOTES
 
Dsa unit 1
Dsa unit 1Dsa unit 1
Dsa unit 1
 
Concept Of C++ Data Types
Concept Of C++ Data TypesConcept Of C++ Data Types
Concept Of C++ Data Types
 
ARRAYS IN C++ CBSE AND STATE +2 COMPUTER SCIENCE
ARRAYS IN C++ CBSE AND STATE +2 COMPUTER SCIENCEARRAYS IN C++ CBSE AND STATE +2 COMPUTER SCIENCE
ARRAYS IN C++ CBSE AND STATE +2 COMPUTER SCIENCE
 
1597380885789.ppt
1597380885789.ppt1597380885789.ppt
1597380885789.ppt
 
2. Introduction to Data Structure.pdf
2. Introduction to Data Structure.pdf2. Introduction to Data Structure.pdf
2. Introduction to Data Structure.pdf
 
data structure programing language in c.ppt
data structure programing language in c.pptdata structure programing language in c.ppt
data structure programing language in c.ppt
 
DATA STRUCTURE IN C LANGUAGE
DATA STRUCTURE IN C LANGUAGEDATA STRUCTURE IN C LANGUAGE
DATA STRUCTURE IN C LANGUAGE
 
8074.pdf
8074.pdf8074.pdf
8074.pdf
 
Data structures introduction
Data structures   introductionData structures   introduction
Data structures introduction
 
Arrays in Data Structure and Algorithm
Arrays in Data Structure and Algorithm Arrays in Data Structure and Algorithm
Arrays in Data Structure and Algorithm
 
intr_ds.ppt
intr_ds.pptintr_ds.ppt
intr_ds.ppt
 
Datastructures and algorithms prepared by M.V.Brehmanada Reddy
Datastructures and algorithms prepared by M.V.Brehmanada ReddyDatastructures and algorithms prepared by M.V.Brehmanada Reddy
Datastructures and algorithms prepared by M.V.Brehmanada Reddy
 
Data structures and algorithms short note (version 14).pd
Data structures and algorithms short note (version 14).pdData structures and algorithms short note (version 14).pd
Data structures and algorithms short note (version 14).pd
 
data structure details of types and .ppt
data structure details of types and .pptdata structure details of types and .ppt
data structure details of types and .ppt
 
Structures in c language
Structures in c languageStructures in c language
Structures in c language
 
Structures in c language
Structures in c languageStructures in c language
Structures in c language
 
PM.ppt
PM.pptPM.ppt
PM.ppt
 

Último

Predicting Salary Using Data Science: A Comprehensive Analysis.pdf
Predicting Salary Using Data Science: A Comprehensive Analysis.pdfPredicting Salary Using Data Science: A Comprehensive Analysis.pdf
Predicting Salary Using Data Science: A Comprehensive Analysis.pdfBoston Institute of Analytics
 
Vision, Mission, Goals and Objectives ppt..pptx
Vision, Mission, Goals and Objectives ppt..pptxVision, Mission, Goals and Objectives ppt..pptx
Vision, Mission, Goals and Objectives ppt..pptxellehsormae
 
Easter Eggs From Star Wars and in cars 1 and 2
Easter Eggs From Star Wars and in cars 1 and 2Easter Eggs From Star Wars and in cars 1 and 2
Easter Eggs From Star Wars and in cars 1 and 217djon017
 
RABBIT: A CLI tool for identifying bots based on their GitHub events.
RABBIT: A CLI tool for identifying bots based on their GitHub events.RABBIT: A CLI tool for identifying bots based on their GitHub events.
RABBIT: A CLI tool for identifying bots based on their GitHub events.natarajan8993
 
modul pembelajaran robotic Workshop _ by Slidesgo.pptx
modul pembelajaran robotic Workshop _ by Slidesgo.pptxmodul pembelajaran robotic Workshop _ by Slidesgo.pptx
modul pembelajaran robotic Workshop _ by Slidesgo.pptxaleedritatuxx
 
Real-Time AI Streaming - AI Max Princeton
Real-Time AI  Streaming - AI Max PrincetonReal-Time AI  Streaming - AI Max Princeton
Real-Time AI Streaming - AI Max PrincetonTimothy Spann
 
GA4 Without Cookies [Measure Camp AMS]
GA4 Without Cookies [Measure Camp AMS]GA4 Without Cookies [Measure Camp AMS]
GA4 Without Cookies [Measure Camp AMS]📊 Markus Baersch
 
RadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdfRadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdfgstagge
 
DBA Basics: Getting Started with Performance Tuning.pdf
DBA Basics: Getting Started with Performance Tuning.pdfDBA Basics: Getting Started with Performance Tuning.pdf
DBA Basics: Getting Started with Performance Tuning.pdfJohn Sterrett
 
Conf42-LLM_Adding Generative AI to Real-Time Streaming Pipelines
Conf42-LLM_Adding Generative AI to Real-Time Streaming PipelinesConf42-LLM_Adding Generative AI to Real-Time Streaming Pipelines
Conf42-LLM_Adding Generative AI to Real-Time Streaming PipelinesTimothy Spann
 
办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一
办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一
办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一F sss
 
Data Factory in Microsoft Fabric (MsBIP #82)
Data Factory in Microsoft Fabric (MsBIP #82)Data Factory in Microsoft Fabric (MsBIP #82)
Data Factory in Microsoft Fabric (MsBIP #82)Cathrine Wilhelmsen
 
Heart Disease Classification Report: A Data Analysis Project
Heart Disease Classification Report: A Data Analysis ProjectHeart Disease Classification Report: A Data Analysis Project
Heart Disease Classification Report: A Data Analysis ProjectBoston Institute of Analytics
 
Advanced Machine Learning for Business Professionals
Advanced Machine Learning for Business ProfessionalsAdvanced Machine Learning for Business Professionals
Advanced Machine Learning for Business ProfessionalsVICTOR MAESTRE RAMIREZ
 
detection and classification of knee osteoarthritis.pptx
detection and classification of knee osteoarthritis.pptxdetection and classification of knee osteoarthritis.pptx
detection and classification of knee osteoarthritis.pptxAleenaJamil4
 
原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档
原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档
原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档208367051
 
科罗拉多大学波尔得分校毕业证学位证成绩单-可办理
科罗拉多大学波尔得分校毕业证学位证成绩单-可办理科罗拉多大学波尔得分校毕业证学位证成绩单-可办理
科罗拉多大学波尔得分校毕业证学位证成绩单-可办理e4aez8ss
 
INTERNSHIP ON PURBASHA COMPOSITE TEX LTD
INTERNSHIP ON PURBASHA COMPOSITE TEX LTDINTERNSHIP ON PURBASHA COMPOSITE TEX LTD
INTERNSHIP ON PURBASHA COMPOSITE TEX LTDRafezzaman
 
Thiophen Mechanism khhjjjjjjjhhhhhhhhhhh
Thiophen Mechanism khhjjjjjjjhhhhhhhhhhhThiophen Mechanism khhjjjjjjjhhhhhhhhhhh
Thiophen Mechanism khhjjjjjjjhhhhhhhhhhhYasamin16
 
9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service
9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service
9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort servicejennyeacort
 

Último (20)

Predicting Salary Using Data Science: A Comprehensive Analysis.pdf
Predicting Salary Using Data Science: A Comprehensive Analysis.pdfPredicting Salary Using Data Science: A Comprehensive Analysis.pdf
Predicting Salary Using Data Science: A Comprehensive Analysis.pdf
 
Vision, Mission, Goals and Objectives ppt..pptx
Vision, Mission, Goals and Objectives ppt..pptxVision, Mission, Goals and Objectives ppt..pptx
Vision, Mission, Goals and Objectives ppt..pptx
 
Easter Eggs From Star Wars and in cars 1 and 2
Easter Eggs From Star Wars and in cars 1 and 2Easter Eggs From Star Wars and in cars 1 and 2
Easter Eggs From Star Wars and in cars 1 and 2
 
RABBIT: A CLI tool for identifying bots based on their GitHub events.
RABBIT: A CLI tool for identifying bots based on their GitHub events.RABBIT: A CLI tool for identifying bots based on their GitHub events.
RABBIT: A CLI tool for identifying bots based on their GitHub events.
 
modul pembelajaran robotic Workshop _ by Slidesgo.pptx
modul pembelajaran robotic Workshop _ by Slidesgo.pptxmodul pembelajaran robotic Workshop _ by Slidesgo.pptx
modul pembelajaran robotic Workshop _ by Slidesgo.pptx
 
Real-Time AI Streaming - AI Max Princeton
Real-Time AI  Streaming - AI Max PrincetonReal-Time AI  Streaming - AI Max Princeton
Real-Time AI Streaming - AI Max Princeton
 
GA4 Without Cookies [Measure Camp AMS]
GA4 Without Cookies [Measure Camp AMS]GA4 Without Cookies [Measure Camp AMS]
GA4 Without Cookies [Measure Camp AMS]
 
RadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdfRadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdf
 
DBA Basics: Getting Started with Performance Tuning.pdf
DBA Basics: Getting Started with Performance Tuning.pdfDBA Basics: Getting Started with Performance Tuning.pdf
DBA Basics: Getting Started with Performance Tuning.pdf
 
Conf42-LLM_Adding Generative AI to Real-Time Streaming Pipelines
Conf42-LLM_Adding Generative AI to Real-Time Streaming PipelinesConf42-LLM_Adding Generative AI to Real-Time Streaming Pipelines
Conf42-LLM_Adding Generative AI to Real-Time Streaming Pipelines
 
办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一
办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一
办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一
 
Data Factory in Microsoft Fabric (MsBIP #82)
Data Factory in Microsoft Fabric (MsBIP #82)Data Factory in Microsoft Fabric (MsBIP #82)
Data Factory in Microsoft Fabric (MsBIP #82)
 
Heart Disease Classification Report: A Data Analysis Project
Heart Disease Classification Report: A Data Analysis ProjectHeart Disease Classification Report: A Data Analysis Project
Heart Disease Classification Report: A Data Analysis Project
 
Advanced Machine Learning for Business Professionals
Advanced Machine Learning for Business ProfessionalsAdvanced Machine Learning for Business Professionals
Advanced Machine Learning for Business Professionals
 
detection and classification of knee osteoarthritis.pptx
detection and classification of knee osteoarthritis.pptxdetection and classification of knee osteoarthritis.pptx
detection and classification of knee osteoarthritis.pptx
 
原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档
原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档
原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档
 
科罗拉多大学波尔得分校毕业证学位证成绩单-可办理
科罗拉多大学波尔得分校毕业证学位证成绩单-可办理科罗拉多大学波尔得分校毕业证学位证成绩单-可办理
科罗拉多大学波尔得分校毕业证学位证成绩单-可办理
 
INTERNSHIP ON PURBASHA COMPOSITE TEX LTD
INTERNSHIP ON PURBASHA COMPOSITE TEX LTDINTERNSHIP ON PURBASHA COMPOSITE TEX LTD
INTERNSHIP ON PURBASHA COMPOSITE TEX LTD
 
Thiophen Mechanism khhjjjjjjjhhhhhhhhhhh
Thiophen Mechanism khhjjjjjjjhhhhhhhhhhhThiophen Mechanism khhjjjjjjjhhhhhhhhhhh
Thiophen Mechanism khhjjjjjjjhhhhhhhhhhh
 
9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service
9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service
9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service
 

C Data Types and Structures Guide

  • 1. Prepared by: Raj Naik SY CE-1 150410107053
  • 2.  Data type specifies the type of data stored in a variable.  Data types in C programming language enables the programmers to appropriately select the data as per requirements of the program and the associated operations of handling it.  The data type can be classified into two types Primitive data type and Non-Primitive data type
  • 3.  The primitive data types are the basic data types that are available in most of the programming languages.  The primitive data types are used to represent single values.  Primitive data are only single values, they have not special capabilities.  Data structure that normally are directly operated upon by machine level instructions are known as primitive structure and data type.
  • 4.  Integer(int): This is used to represent a number without decimal point. Eg: 12, 90  Float and Double: This is used to represent a number with decimal point. Eg: 45.1, 67.3  Character : This is used to represent single character Eg: ‘C’, ‘a’
  • 5.  Syntax for integer: int variable_name;  Syntax for float: float variable_name;  Syntax for double: double variable_name;  Syntax for chracter: char variable_name;
  • 6. Datatype Size(in bytes) Range Integer int signed int unsigned int short int signed short int unsigned short int long int signed long int unsigned long int 2 2 2 1 1 1 4 4 4 -32,768 to 32,767 -32,768 to 32,767 0 to 65535 -128 to 127 -128 to 127 0 to 255 -2,147,483,648 to 2,147,483,647 Same as Above 0 to 4,294,967,295 Float & Double float double long double 4 8 10 3.4E-38 to 3.4E+38 1.7E-308 to 1.7E+308 3.4E-4932 to 1.1E+4932 Character char signed char unsigned char 1 1 1 -128 to 127 -128 to 127 0 to 255
  • 7.  The data types that are derived from primary data types are known as non-Primitive data types.  These data types are used to store group of values.  The non-primitive data types are, Arrays Structure Union linked list Stacks Queue
  • 8.  An array is used to store a collection of variables of the same data type.  A specific element in an array is accessed by an index.  All arrays consist of contiguous memory locations.  Syntax for declaring array is, data type arrayName [ arraySize ];  Initializing Arrays, double balance[5] = {1000.0, 2.0, 3.4, 7.0, 50.0};  The lowest address corresponds to the first element and the highest address to the last element.
  • 9.  Structure is another user defined data type available in C that allows to combine data items of different kinds.  Structures are used to represent a record.  To define a structure, we must use the struct statement. The struct statement defines a new data type, with more than one member. The format of the struct statement is as follows −  struct [structure tag] { member definition; member definition; ... member definition; } [one or more structure variables];  struct Books { char title[50]; char author[50]; char subject[100]; int book_id; } book;
  • 10.  A union is a special data type available in C that allows to store different data types in the same memory location. We can define a union with many members, but only one member can contain a value at any given time. Unions provide an efficient way of using the same memory location for multiple-purpose.  To define a union, we must use the union statement  union [union tag] { member definition; member definition; ... member definition; } [one or more union variables];
  • 11.  Here is the way that we could define a union type named Data having three members i, f, and str −  union Data { int i; float f; char str[20]; } data;  The memory occupied by a union will be large enough to hold the largest member of the union. For example, in the above example, Data type will occupy 20 bytes of memory space because this is the maximum space which can be occupied by a character string.
  • 12.  The linked list consists of series of structures. They are not required to be stored in adjacent memory location. Each structure consists of a data field and address field. Address field contains the address of its successors.  The actual representation of the structure is as follow:  A variable of the above structure type is conventionally known as node.  Here the representation of a linked list of three nodes: Node A Node B Node C Data Address X1 X2 X3
  • 13.  Node A stored data X1 and the address of the successor node B. Node B stores the data X2 and the address of its successor node C. node C contains the data X3 and its address field is grounded, indicating it does not have successor.  There are three types of Linked List:  Singly Linked List  Doubly Linked List  Circular Linked List  Linked lists are the best and simplest example of a dynamic data structure that uses pointers for its implementation.  Items can be added or removed from the middle of the list.  There is no need to define an initial size.
  • 14.  Stack can be implemented using the Linked List or Array.  Stack is LIFO Structure [ Last in First Out ]  Stack is Ordered List of Elements of Same Type.  Stack is Linear List  In Stack all Operations such as Insertion and Deletion are permitted at only one end called Top Position of Top Status of Stack -1 Stack is Empty 0 First Element is Just Added into Stack N-1 Stack is said to Full N Stack is said to be Overflow
  • 15.  Queue is a specialized data storage structure (Abstract data type).  Arrays access of elements in a Queue is restricted.  It has two main operations enqueue and dequeue.  Insertion in a queue is done using enqueue function and removal from a queue is done using dequeue function.  An item can be inserted at the end of the queue and removed from the front of the queue.  It is therefore, also called First-In-First-Out (FIFO) list.
  • 16.  Queue has important properties,  capacity stands for the maximum number of elements Queue can hold,  size stands for the current size of the Queue,  elements is the array of elements,  It has two basic implementations,  Array-based implementation – It’s simple and efficient but the maximum size of the queue is fixed.  Singly Linked List-based implementation – It’s complicated but there is no limit  on the queue size, it is subjected to the available memory.