SlideShare a Scribd company logo
Presentation
of
C
Subject :- Pointers
Submitted to:-
Miss. Diya Sharma Submitted by :-
Lovepreet (023)
Grace (010)
Pointers
 Pointers are memory addresses variables i.e. the variables, which have
addresses of the variables having some value, stored in the memory.
 It represented as :
variable memory memory memory
name value address variable
q 280 6000 p
(pointer)
Declaring a Pointer Variable (Initialization of Pointer):
 A pointer variable should be declared before they are used. If a variables
going to hold a pointer, it must be declared as such. A pointer declaration
consists of a base type, an * , and variable name. base type define data
type………… its used in beginning of the main program.
 Syntax :-
data-type *pointer-variable ;
int *m; ,
float * y; ,
char * z; ……………….
Expressions
 An expression is a combination of operands and operators. It is a combination
of two or more than two operands or many operators.
 Example:- a+b*c/d and so on………….
Pointers expression
 Pointers deals with the arithmetic, relational, logical and assignment expressions.
Pointers are not directly used in the arithmetic, relational, logical and assignment
expression, only pointer values are used. Some of the arithmetic expression used
with pointer p1 and p2 as follow:
 Int x, y, *p1, *p2, z, a, b, c;
x = 10;
y = 20;
p1 = &x;
p2 = &y;
Z = (*p1)/(*p2);
a = (*p1)*(*p2);
b = (*p1)+(*p2);
c = (*p1)-(*p2);
Array
 Array is similar type of data collection name i.e. it is a collection of same
data type elements. An array is a group of related data items, which share
common name.
“It is the set of homogenous data”
a(0) a(1) a(3) a(4) or a{0., 1, 2, 3, 4}
Pointers with Array
 Pointers have close relationship with array. Pointers are linked with array
by taking its first element number and its base address. Suppose an array
of integer type, which is as defined as below:
 Static int a[5] = {25, 30, 35, 40, 45}
 Its can be represented in the computer memory as;
 a(0) a(1) a(2) a(3) a(4)
 Value address 25 30 35 40 45
 1000 1002 1004 1006 1008
Pointers and Function:
 We can pass pointer to the function and also pointer addresses can be
passed to the function as pointer arguments. This can be represented by
two ways…………..
 A). Pointer as function argument
 B) Pointer to function
Pointer as function argument
 1) Call by reference
 2) call by value
 swapping: exchanging of value from one variable to another……..
ex = X and Y
Dynamic Memory Allocation
 In dynamic memory allocation of the memory, the declaration of variable is
no longer required. The job of memory allocation can be done bye using the
three functions……
 1) maclloc():
 2) calloc():
 3) realoc():
1). maclloc():
syntax = viod*maclloc(unsigned size);
2). calloc():
syntax = void*calloc(xyz, unsigned size);
3). realloc():
syntax = viod*realloc(void*block, unsigned size);
Presentation of c 1

More Related Content

What's hot (20)

PPTX
Arrays 1D and 2D , and multi dimensional
Appili Vamsi Krishna
 
PPTX
2CPP06 - Arrays and Pointers
Michael Heron
 
PDF
Pointer
Learn By Watch
 
PPTX
Pointers in c - Mohammad Salman
MohammadSalman129
 
PPT
Pointers - DataStructures
Omair Imtiaz Ansari
 
PPTX
C++ lecture 04
HNDE Labuduwa Galle
 
PPTX
C pointer
University of Potsdam
 
PPTX
Fundamentals of Pointers in C
ShivanshuVerma11
 
PPTX
C++ programming (Array)
طارق بالحارث
 
PPTX
ppt on pointers
Riddhi Patel
 
PPTX
arrays of structures
arushi bhatnagar
 
PPTX
Array in c++
Mahesha Mano
 
PPTX
Pointers in c v5 12102017 1
tanmaymodi4
 
PPT
Pointers in C
Prabhu Govind
 
PPTX
Array in (C) programing
mJafarww
 
PPT
Array in c
Ravi Gelani
 
PPTX
Pointers in C Language
madan reddy
 
PPTX
concept of Array, 1D & 2D array
Sangani Ankur
 
Arrays 1D and 2D , and multi dimensional
Appili Vamsi Krishna
 
2CPP06 - Arrays and Pointers
Michael Heron
 
Pointers in c - Mohammad Salman
MohammadSalman129
 
Pointers - DataStructures
Omair Imtiaz Ansari
 
C++ lecture 04
HNDE Labuduwa Galle
 
Fundamentals of Pointers in C
ShivanshuVerma11
 
C++ programming (Array)
طارق بالحارث
 
ppt on pointers
Riddhi Patel
 
arrays of structures
arushi bhatnagar
 
Array in c++
Mahesha Mano
 
Pointers in c v5 12102017 1
tanmaymodi4
 
Pointers in C
Prabhu Govind
 
Array in (C) programing
mJafarww
 
Array in c
Ravi Gelani
 
Pointers in C Language
madan reddy
 
concept of Array, 1D & 2D array
Sangani Ankur
 

Similar to Presentation of c 1 (20)

PPTX
C Programming : Pointers and Arrays, Pointers and Strings
Selvaraj Seerangan
 
PPT
Pointers on data structure in computer science.ppt
MdSabbirAhmedEkhon
 
PPTX
POLITEKNIK MALAYSIA
Aiman Hud
 
PPT
Pointers C programming
Appili Vamsi Krishna
 
PPT
Pointers definition syntax structure use
dheeraj658032
 
PPT
Chapter09-10 Pointers and operations .PPT
ShalabhMishra10
 
PPT
Chapter09-10.PPT
shubhamshukla9769280
 
PPT
Lecture 18 - Pointers
Md. Imran Hossain Showrov
 
PPTX
Pointers
Vardhil Patel
 
PPTX
C programming - Pointer and DMA
Achyut Devkota
 
PDF
Data structure week 2
karmuhtam
 
PPTX
pointer_in_c_programming_structure and uses.pptx
SanthoshK318551
 
PPT
Ch6 pointers (latest)
Hattori Sidek
 
PDF
C Recursion, Pointers, Dynamic memory management
Sreedhar Chowdam
 
PPTX
unit-7 Pointerdesfsdfsdgsdgaa notes.pptx
TriggeredZulkar
 
PDF
0-Slot11-12-Pointers.pdf
ssusere19c741
 
PPTX
POINTERS in C language:- Mastering-Pointers-in-C
mushtaqsaliq9
 
PPTX
Pointers Notes.pptx
kartikeysaxenaco21a4
 
PPTX
Pointers in c language
Tanmay Modi
 
PDF
C pointers and references
Thesis Scientist Private Limited
 
C Programming : Pointers and Arrays, Pointers and Strings
Selvaraj Seerangan
 
Pointers on data structure in computer science.ppt
MdSabbirAhmedEkhon
 
POLITEKNIK MALAYSIA
Aiman Hud
 
Pointers C programming
Appili Vamsi Krishna
 
Pointers definition syntax structure use
dheeraj658032
 
Chapter09-10 Pointers and operations .PPT
ShalabhMishra10
 
Chapter09-10.PPT
shubhamshukla9769280
 
Lecture 18 - Pointers
Md. Imran Hossain Showrov
 
Pointers
Vardhil Patel
 
C programming - Pointer and DMA
Achyut Devkota
 
Data structure week 2
karmuhtam
 
pointer_in_c_programming_structure and uses.pptx
SanthoshK318551
 
Ch6 pointers (latest)
Hattori Sidek
 
C Recursion, Pointers, Dynamic memory management
Sreedhar Chowdam
 
unit-7 Pointerdesfsdfsdgsdgaa notes.pptx
TriggeredZulkar
 
0-Slot11-12-Pointers.pdf
ssusere19c741
 
POINTERS in C language:- Mastering-Pointers-in-C
mushtaqsaliq9
 
Pointers Notes.pptx
kartikeysaxenaco21a4
 
Pointers in c language
Tanmay Modi
 
C pointers and references
Thesis Scientist Private Limited
 
Ad

Recently uploaded (20)

PDF
Introduction to Productivity and Quality
মোঃ ফুরকান উদ্দিন জুয়েল
 
PPTX
Damage of stability of a ship and how its change .pptx
ehamadulhaque
 
PDF
Ethics and Trustworthy AI in Healthcare – Governing Sensitive Data, Profiling...
AlqualsaDIResearchGr
 
PPTX
Shinkawa Proposal to meet Vibration API670.pptx
AchmadBashori2
 
PPTX
MobileComputingMANET2023 MobileComputingMANET2023.pptx
masterfake98765
 
DOC
MRRS Strength and Durability of Concrete
CivilMythili
 
PPTX
Hashing Introduction , hash functions and techniques
sailajam21
 
PDF
PORTFOLIO Golam Kibria Khan — architect with a passion for thoughtful design...
MasumKhan59
 
PDF
Set Relation Function Practice session 24.05.2025.pdf
DrStephenStrange4
 
PDF
AI TECHNIQUES FOR IDENTIFYING ALTERATIONS IN THE HUMAN GUT MICROBIOME IN MULT...
vidyalalltv1
 
PPTX
VITEEE 2026 Exam Details , Important Dates
SonaliSingh127098
 
PPTX
265587293-NFPA 101 Life safety code-PPT-1.pptx
chandermwason
 
PPTX
Element 7. CHEMICAL AND BIOLOGICAL AGENT.pptx
merrandomohandas
 
PPTX
artificial intelligence applications in Geomatics
NawrasShatnawi1
 
PDF
Zilliz Cloud Demo for performance and scale
Zilliz
 
PDF
Electrical Engineer operation Supervisor
ssaruntatapower143
 
PPTX
Solar Thermal Energy System Seminar.pptx
Gpc Purapuza
 
PDF
Reasons for the succes of MENARD PRESSUREMETER.pdf
majdiamz
 
PPTX
Worm gear strength and wear calculation as per standard VB Bhandari Databook.
shahveer210504
 
PPTX
美国电子版毕业证南卡罗莱纳大学上州分校水印成绩单USC学费发票定做学位证书编号怎么查
Taqyea
 
Introduction to Productivity and Quality
মোঃ ফুরকান উদ্দিন জুয়েল
 
Damage of stability of a ship and how its change .pptx
ehamadulhaque
 
Ethics and Trustworthy AI in Healthcare – Governing Sensitive Data, Profiling...
AlqualsaDIResearchGr
 
Shinkawa Proposal to meet Vibration API670.pptx
AchmadBashori2
 
MobileComputingMANET2023 MobileComputingMANET2023.pptx
masterfake98765
 
MRRS Strength and Durability of Concrete
CivilMythili
 
Hashing Introduction , hash functions and techniques
sailajam21
 
PORTFOLIO Golam Kibria Khan — architect with a passion for thoughtful design...
MasumKhan59
 
Set Relation Function Practice session 24.05.2025.pdf
DrStephenStrange4
 
AI TECHNIQUES FOR IDENTIFYING ALTERATIONS IN THE HUMAN GUT MICROBIOME IN MULT...
vidyalalltv1
 
VITEEE 2026 Exam Details , Important Dates
SonaliSingh127098
 
265587293-NFPA 101 Life safety code-PPT-1.pptx
chandermwason
 
Element 7. CHEMICAL AND BIOLOGICAL AGENT.pptx
merrandomohandas
 
artificial intelligence applications in Geomatics
NawrasShatnawi1
 
Zilliz Cloud Demo for performance and scale
Zilliz
 
Electrical Engineer operation Supervisor
ssaruntatapower143
 
Solar Thermal Energy System Seminar.pptx
Gpc Purapuza
 
Reasons for the succes of MENARD PRESSUREMETER.pdf
majdiamz
 
Worm gear strength and wear calculation as per standard VB Bhandari Databook.
shahveer210504
 
美国电子版毕业证南卡罗莱纳大学上州分校水印成绩单USC学费发票定做学位证书编号怎么查
Taqyea
 
Ad

Presentation of c 1

  • 1. Presentation of C Subject :- Pointers Submitted to:- Miss. Diya Sharma Submitted by :- Lovepreet (023) Grace (010)
  • 2. Pointers  Pointers are memory addresses variables i.e. the variables, which have addresses of the variables having some value, stored in the memory.  It represented as : variable memory memory memory name value address variable q 280 6000 p (pointer)
  • 3. Declaring a Pointer Variable (Initialization of Pointer):  A pointer variable should be declared before they are used. If a variables going to hold a pointer, it must be declared as such. A pointer declaration consists of a base type, an * , and variable name. base type define data type………… its used in beginning of the main program.  Syntax :- data-type *pointer-variable ; int *m; , float * y; , char * z; ……………….
  • 4. Expressions  An expression is a combination of operands and operators. It is a combination of two or more than two operands or many operators.  Example:- a+b*c/d and so on………….
  • 5. Pointers expression  Pointers deals with the arithmetic, relational, logical and assignment expressions. Pointers are not directly used in the arithmetic, relational, logical and assignment expression, only pointer values are used. Some of the arithmetic expression used with pointer p1 and p2 as follow:  Int x, y, *p1, *p2, z, a, b, c; x = 10; y = 20; p1 = &x; p2 = &y; Z = (*p1)/(*p2); a = (*p1)*(*p2); b = (*p1)+(*p2); c = (*p1)-(*p2);
  • 6. Array  Array is similar type of data collection name i.e. it is a collection of same data type elements. An array is a group of related data items, which share common name. “It is the set of homogenous data” a(0) a(1) a(3) a(4) or a{0., 1, 2, 3, 4}
  • 7. Pointers with Array  Pointers have close relationship with array. Pointers are linked with array by taking its first element number and its base address. Suppose an array of integer type, which is as defined as below:  Static int a[5] = {25, 30, 35, 40, 45}  Its can be represented in the computer memory as;  a(0) a(1) a(2) a(3) a(4)  Value address 25 30 35 40 45  1000 1002 1004 1006 1008
  • 8. Pointers and Function:  We can pass pointer to the function and also pointer addresses can be passed to the function as pointer arguments. This can be represented by two ways…………..  A). Pointer as function argument  B) Pointer to function
  • 9. Pointer as function argument  1) Call by reference  2) call by value  swapping: exchanging of value from one variable to another…….. ex = X and Y
  • 10. Dynamic Memory Allocation  In dynamic memory allocation of the memory, the declaration of variable is no longer required. The job of memory allocation can be done bye using the three functions……  1) maclloc():  2) calloc():  3) realoc():
  • 11. 1). maclloc(): syntax = viod*maclloc(unsigned size); 2). calloc(): syntax = void*calloc(xyz, unsigned size); 3). realloc(): syntax = viod*realloc(void*block, unsigned size);