SlideShare a Scribd company logo
Pointers
What you’ll learn:
o Introduction to pointers
o Pointers and arrays
o Pointers and functions
Introduction to Pointers
 A pointer is a variable that holds memory address of other variables.
 It always contains an unsigned int value (memory address cant be negative).
 The data type of pointer depends on the data type of variable it is pointing to.
How Pointers work
int a = 5;
int *ptr = &a;
5
10000
10000
12895
Memory Address of a
Value of a
Value of ptr
Memory Address of ptr
Variable name
Data type
Variable value
Address of
operator
Variable being
pointed to
Pointer
variable
Data type of
variable
being
pointed to
Indirection(or
value at address)
operator
&a *ptr ptr &ptra

More Related Content

PPTX
Introduction to c++
PDF
Data types in python
PPTX
Finite state system or finite automata
PPTX
Python data type
PDF
Types of pointer in C
PPTX
FUNDAMENTAL OF C
PDF
Lesson 02 python keywords and identifiers
PPTX
Control satkcher ppt
Introduction to c++
Data types in python
Finite state system or finite automata
Python data type
Types of pointer in C
FUNDAMENTAL OF C
Lesson 02 python keywords and identifiers
Control satkcher ppt

What's hot (18)

PDF
JetBrains MPS: Editor Aspect
PDF
Problem solving (programming) 5
PPTX
Module 3 : using value type variables
PPTX
Fundamentals of C Programming Language
DOC
Week2 dq3
PPTX
Generics
PDF
Lecturer23 pointersin c.ppt
PPTX
Values and Data types in python
PDF
JetBrains MPS: Typesystem Aspect
PPTX
5.functions
PDF
Data handling CBSE PYTHON CLASS 11
PDF
Functions-Computer programming
PPT
Complicated declarations in c
PDF
Pointers In C
PPTX
Data types in python
PPTX
Introduction to C Programming - R.D.Sivakumar
PDF
2 variables and data types
PPTX
Chapter 9 python fundamentals
JetBrains MPS: Editor Aspect
Problem solving (programming) 5
Module 3 : using value type variables
Fundamentals of C Programming Language
Week2 dq3
Generics
Lecturer23 pointersin c.ppt
Values and Data types in python
JetBrains MPS: Typesystem Aspect
5.functions
Data handling CBSE PYTHON CLASS 11
Functions-Computer programming
Complicated declarations in c
Pointers In C
Data types in python
Introduction to C Programming - R.D.Sivakumar
2 variables and data types
Chapter 9 python fundamentals
Ad

Viewers also liked (7)

PPTX
2.decision making
PPTX
1.getting started with c
PPTX
8.derived data types
PPTX
6.operators
PPTX
4.arrays
PPTX
3.looping(iteration statements)
PDF
Programming & Data Structure Lecture Notes
2.decision making
1.getting started with c
8.derived data types
6.operators
4.arrays
3.looping(iteration statements)
Programming & Data Structure Lecture Notes
Ad

7.pointers

  • 1. Pointers What you’ll learn: o Introduction to pointers o Pointers and arrays o Pointers and functions
  • 2. Introduction to Pointers  A pointer is a variable that holds memory address of other variables.  It always contains an unsigned int value (memory address cant be negative).  The data type of pointer depends on the data type of variable it is pointing to.
  • 3. How Pointers work int a = 5; int *ptr = &a; 5 10000 10000 12895 Memory Address of a Value of a Value of ptr Memory Address of ptr Variable name Data type Variable value Address of operator Variable being pointed to Pointer variable Data type of variable being pointed to Indirection(or value at address) operator &a *ptr ptr &ptra