SlideShare a Scribd company logo
Pointer
2
Pointer Declaration and Assignment
 Variables and address
– Structure of Memory
– Each variable is placed in a specified address
• Pointer: Address of variables
…
1000 ‘a’
1001
3.2
1005
4
…
ch, 1bytes
f, 4bytes
i, 4bytes
char ch = ‘a’ ;
float f = 3.2 ;
int i = 4 ;
address
3
Pointer Declaration and Assignment
 Variables and address
– We can get pointers of variables from the variables
char ch = ‘a’ ;
float f = 3.2 ;
int i = 4 ;
printf( “%d %d %dn”, &a, &f, &i ) ;
&(name of variable) == address of variable …
1000 ‘a’
1001
3.2
1005
4
…
Address of
operator
4
Pointer Declaration and Assignment
 Variables and address
– We can access the variable with the pointer of the variable
char ch ;
float f ;
int i ;
*(&ch) = ‘a’ ;
*(&f) = 3.2 ;
*(&i) = 4 ;
*(address) means the variable in the address
…
1000 ‘a’
1001
3.2
1005
4
…
char ch ;
float f ;
int i ;
ch = ‘a’ ;
f = 3.2 ;
i = 4 ;
Indirect
operator
5
Pointer Declaration and Assignment
 Pointer Variable
– The variable which can hold addresses of variables
char ch = ‘a’ ;
float f = 3.2 ;
int i = 4 ;
char *pch ;
float *pf ;
int *pi ;
pch = &ch ;
pf = &f ;
pi = &i ;
printf( “%d %d %dn”, pch, pf, pi ) ;
data_type * pointer_varaible;
Variable can hold
only ‘char’ type pointer
Variable can hold
only ‘float’ type pointer
Variable can hold
only ‘int’ type pointer
char *pch = &ch ;
float *pf = &f ;
int *pi = &i ;
6
Pointer Declaration and Assignment
 Pointer Variable
char ch ;
float f ;
int i ;
ch = ‘a’ ;
f = 3.2 ;
i = 4 ;
char ch ;
float f ;
int i ;
char *pch = &ch ;
float *pf = &f ;
int *pi = &i ;
*pch = ‘a’ ;
*pf = 3.2 ;
*pi = 4 ;
…
1000 ‘a’
1001
3.2
1005
4
…
7
Pointer Declaration and Assignment
 Pointer Variable
– The size of all pointer variables is 4 bytes (4 byte machine)
• why??
char *pch ;
float *pf ;
int *pi ;
printf( “%dn”, sizeof(pch) ) ;
printf( “%dn”, sizeof(pf) ) ;
printf( “%dn”, sizeof(pi) ) ;
int i = 0 ;
int *pi = & i;
printf( “%dn”, i ) ;
printf( “%dn”, *pi ) ;
printf( “%dn”, &pi ) ;
8
Pointer Declaration and Assignment
 Pointer Variable
– Since a pointer variable is also a variable, it has it own
address, like other variables do
int i = 0 ;
int *pi = &i;
printf( “%dn”, i ) ;
printf( “%dn”, *pi ) ;
printf( “%dn”, &pi ) ;
1000
…
1020
…
pi, 4 bytes
i, 4 bytes
 Example
9
Pointer Declaration and Assignment
[Ex] int *p;
int month=3;
p = &month;
Assign the address of ‘month’
to pointer variable
p month
3
p
1000
month
31000
Use an arrow instead of
writing address in a
pointer variable
 Example
10
Addressing and Dereferencing
[Ex] int a, b;
int *p;
a = b = 7;
p = &a;
printf(“*p = %dn”, *p);
*p = 3;
printf(“a = %dn”, a);
*p == 7
The variable pointed by p, that is a
The variable pointed by p, a, has 3
assign the address of a to p
*p = 7
a = 3
11
Addressing and Dereferencing
[Ex1] int a, b;
int *p;
a = b = 7;
p = &a;
*p = 3;
p = &b;
*p = 2 * *p – a;
pa
7
b
7
p
3
a b
7
pa
3 11
b
 Example
 Prone to error
12
Addressing and Dereferencing
[Ex1] int x, *p;
x = 10;
*p = x;
[Ex3] int x, *p;
x = 10;
p = x;
Error!!
Can’t assign value x to pointer p
because p is not initialized.
We don’t know where p points
Error!!
Can’t assign value x to pointer p
because p cannot hold an integer variable
13
Multi Pointer Variable
 Multi Pointer Variable
– i is a integer variable
– p is a pointer can hold the address of an integer variable
– q is a pointer can hold the address of a pointer variable of
integer variables
• The size of pointer variable q is 4 byte (32bit machine)
int i = 4 ;
int *p ;
int **q ;
 Example
14
Pointer Declaration and Assignment
[Ex] int i = 3;
int *p ;
int **q ;
p = &i ;
q = &p ;
p i
3
i
31000
p
10002000
q
20003000
q
 Example:
– What are the values of i and j,
respectively?
– Assume that the addresses of i,
j, p and q are 1000, 2000, 3000
and 4000, respectively.
– What are the values of p, q, r?
15
Pointer Declaration and Assignment
[Ex] int i = 3, j = 2;
int *p, *q ;
int **r ;
p = &i ;
q = &j ;
r = &p ;
*p = 4 ;
*q = 5 ;
**r = 6 ;
*r = &q ;
q =&i ;
**r = 7 ;
 Example
16
Swap Function
[Ex]
void swap(int i, int j) {
int temp = i ;
i = j;
j = temp;
}
int main(void) {
int a=3, b=7;
printf(“before swap : %d %dn”, a, b);
swap( a, b );
printf(“after swap : %d %dn”, a, b);
}
Can it swap values of a and b?
 Example
17
Swap Function
[Ex]
void swap(int *p, int *q) {
int temp = *p ;
*p = *q;
*q = temp;
}
int main(void) {
int a=3, b=7;
printf(“before swap : %d %dn”, a, b);
swap(&a, &b);
printf(“after swap : %d %dn”, a, b);
}
before swap : 3 7
after swap : 7 3
 Swap values of two pointer variables
18
Swap Function
[Ex]
void swap(int **pp, int **qq) {
int *temp = *pp ;
*pp = *qq;
*qq = temp;
}
int main(void) {
int a=3, b=7;
int *p = &a, *q = &b ;
printf(“before swap : %d %dn”, *p, *q);
swap(&p, &q);
printf(“after swap : %d %dn”, *p, *q);
}
before swap : 3 7
after swap : 7 3
19
Call-by-Value
1 1
a in main a in function
main() function function() function
a = a + 1 ;
When function(a); is
called, value of a in main
is copied to a in function
2
After Return;
1 Variable a in main and a in function are
not identical, so that value of a in main
is not changed
1
20
Call-by-Value
1 1
a in main a in function
main() function function() function
a = a + 1 ;
When function(a); is
called, value of a in main
is copied to a in function
2
After Return;
1 Variable a in main and a in function are
not identical, so that value of a in main
is not changed
1

More Related Content

What's hot (20)

PPTX
C Programming Language Part 11
Rumman Ansari
 
PDF
Data Structure - 2nd Study
Chris Ohk
 
PPT
Pointers+(2)
Rubal Bansal
 
PPTX
Pointer in C
bipchulabmki
 
PDF
8 arrays and pointers
MomenMostafa
 
PPTX
C Programming Language Part 6
Rumman Ansari
 
PPTX
C Programming Language Part 7
Rumman Ansari
 
PPT
Functions and pointers_unit_4
Saranya saran
 
PPTX
Function recap
alish sha
 
PDF
9 character string & string library
MomenMostafa
 
PPT
detailed information about Pointers in c language
gourav kottawar
 
PPT
Intro to c programming
Prabhu Govind
 
PPT
Pointer in C
Sonya Akter Rupa
 
PPTX
C Programming Language Step by Step Part 2
Rumman Ansari
 
PDF
6 c control statements branching & jumping
MomenMostafa
 
PDF
C++ Programming - 11th Study
Chris Ohk
 
PPTX
CHAPTER 4
mohd_mizan
 
DOC
Lab 6
alish sha
 
PDF
C++ Programming - 2nd Study
Chris Ohk
 
DOC
Lab 9 sem ii_12_13
alish sha
 
C Programming Language Part 11
Rumman Ansari
 
Data Structure - 2nd Study
Chris Ohk
 
Pointers+(2)
Rubal Bansal
 
Pointer in C
bipchulabmki
 
8 arrays and pointers
MomenMostafa
 
C Programming Language Part 6
Rumman Ansari
 
C Programming Language Part 7
Rumman Ansari
 
Functions and pointers_unit_4
Saranya saran
 
Function recap
alish sha
 
9 character string & string library
MomenMostafa
 
detailed information about Pointers in c language
gourav kottawar
 
Intro to c programming
Prabhu Govind
 
Pointer in C
Sonya Akter Rupa
 
C Programming Language Step by Step Part 2
Rumman Ansari
 
6 c control statements branching & jumping
MomenMostafa
 
C++ Programming - 11th Study
Chris Ohk
 
CHAPTER 4
mohd_mizan
 
Lab 6
alish sha
 
C++ Programming - 2nd Study
Chris Ohk
 
Lab 9 sem ii_12_13
alish sha
 

Viewers also liked (7)

PPT
Advanced+pointers
Rubal Bansal
 
PPTX
Data structure lecture 1
Samsil Arefin
 
PPTX
C pointer
University of Potsdam
 
PPT
6 pointers functions
Docent Education
 
PPT
Pointers in C
guestdc3f16
 
PDF
C Pointers
omukhtar
 
PPTX
Human values & professional ethics
Mahamaya technical university
 
Advanced+pointers
Rubal Bansal
 
Data structure lecture 1
Samsil Arefin
 
6 pointers functions
Docent Education
 
Pointers in C
guestdc3f16
 
C Pointers
omukhtar
 
Human values & professional ethics
Mahamaya technical university
 
Ad

Similar to 9. pointer, pointer & function (20)

PPT
l7-pointers.ppt
ShivamChaturvedi67
 
PPTX
Pointers
Munazza-Mah-Jabeen
 
PPT
pointers CP Lecture.ppt
EC42ShaikhAmaan
 
PPTX
c++ pointers by Amir Hamza Khan (SZABISTIAN)
Ameer Hamxa
 
PPT
l7-pointers.ppt
ssuser2076d9
 
PPT
l7-pointers_ dynamic memory allocation c programming
trwdcn
 
PPTX
UNIT 6structureofcprogrammingforppt.pptx
jayantpatil745
 
PPTX
Unit-4-1.pptxjtjrjfjfjfjfjfjfjfjrjrjrjrjejejeje
KathanPatel49
 
PPTX
UNIT 4 POINTERS.pptx pointers pptx for basic c language
wwwskrilikeyou
 
PDF
Lk module5 pointers
Krishna Nanda
 
PPTX
Algoritmos e Estruturas de Dados - Pointers
martijnkuipersandebo
 
PDF
PSPC--UNIT-5.pdf
ArshiniGubbala3
 
PPTX
chapter-7 slide.pptx
cricketreview
 
PPT
3.pointers in c programming language.ppt
anithachristopher3
 
PDF
[ITP - Lecture 13] Introduction to Pointers
Muhammad Hammad Waseem
 
PDF
Chapter 13.1.8
patcha535
 
PPT
Pointers C programming
Appili Vamsi Krishna
 
PPTX
Pointers in C Language
madan reddy
 
PDF
L7 pointers
Kathmandu University
 
PPT
358 33 powerpoint-slides_3-pointers_chapter-3
sumitbardhan
 
l7-pointers.ppt
ShivamChaturvedi67
 
pointers CP Lecture.ppt
EC42ShaikhAmaan
 
c++ pointers by Amir Hamza Khan (SZABISTIAN)
Ameer Hamxa
 
l7-pointers.ppt
ssuser2076d9
 
l7-pointers_ dynamic memory allocation c programming
trwdcn
 
UNIT 6structureofcprogrammingforppt.pptx
jayantpatil745
 
Unit-4-1.pptxjtjrjfjfjfjfjfjfjfjrjrjrjrjejejeje
KathanPatel49
 
UNIT 4 POINTERS.pptx pointers pptx for basic c language
wwwskrilikeyou
 
Lk module5 pointers
Krishna Nanda
 
Algoritmos e Estruturas de Dados - Pointers
martijnkuipersandebo
 
PSPC--UNIT-5.pdf
ArshiniGubbala3
 
chapter-7 slide.pptx
cricketreview
 
3.pointers in c programming language.ppt
anithachristopher3
 
[ITP - Lecture 13] Introduction to Pointers
Muhammad Hammad Waseem
 
Chapter 13.1.8
patcha535
 
Pointers C programming
Appili Vamsi Krishna
 
Pointers in C Language
madan reddy
 
358 33 powerpoint-slides_3-pointers_chapter-3
sumitbardhan
 
Ad

More from 웅식 전 (20)

PDF
15 3. modulization
웅식 전
 
PDF
15 2. arguement passing to main
웅식 전
 
PDF
14. fiile io
웅식 전
 
PDF
13. structure
웅식 전
 
PDF
12 2. dynamic allocation
웅식 전
 
PDF
12 1. multi-dimensional array
웅식 전
 
PDF
11. array & pointer
웅식 전
 
PDF
10. pointer & function
웅식 전
 
PDF
9. pointer
웅식 전
 
PDF
7. variable scope rule,-storage_class
웅식 전
 
PDF
6. function
웅식 전
 
PDF
5 2. string processing
웅식 전
 
PDF
5 1. character processing
웅식 전
 
PDF
15 1. enumeration, typedef
웅식 전
 
PDF
4. loop
웅식 전
 
PDF
3 2. if statement
웅식 전
 
PDF
3 1. preprocessor, math, stdlib
웅식 전
 
PDF
2 3. standard io
웅식 전
 
PDF
2 2. operators
웅식 전
 
PDF
2 1. variables & data types
웅식 전
 
15 3. modulization
웅식 전
 
15 2. arguement passing to main
웅식 전
 
14. fiile io
웅식 전
 
13. structure
웅식 전
 
12 2. dynamic allocation
웅식 전
 
12 1. multi-dimensional array
웅식 전
 
11. array & pointer
웅식 전
 
10. pointer & function
웅식 전
 
9. pointer
웅식 전
 
7. variable scope rule,-storage_class
웅식 전
 
6. function
웅식 전
 
5 2. string processing
웅식 전
 
5 1. character processing
웅식 전
 
15 1. enumeration, typedef
웅식 전
 
4. loop
웅식 전
 
3 2. if statement
웅식 전
 
3 1. preprocessor, math, stdlib
웅식 전
 
2 3. standard io
웅식 전
 
2 2. operators
웅식 전
 
2 1. variables & data types
웅식 전
 

Recently uploaded (20)

PPTX
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Pitch ...
Michele Kryston
 
PDF
Kubernetes - Architecture & Components.pdf
geethak285
 
PPTX
Practical Applications of AI in Local Government
OnBoard
 
PPTX
Enabling the Digital Artisan – keynote at ICOCI 2025
Alan Dix
 
PDF
Why aren't you using FME Flow's CPU Time?
Safe Software
 
PPSX
Usergroup - OutSystems Architecture.ppsx
Kurt Vandevelde
 
PDF
Optimizing the trajectory of a wheel loader working in short loading cycles
Reno Filla
 
PDF
ArcGIS Utility Network Migration - The Hunter Water Story
Safe Software
 
PDF
Automating the Geo-Referencing of Historic Aerial Photography in Flanders
Safe Software
 
PDF
Open Source Milvus Vector Database v 2.6
Zilliz
 
PDF
Database Benchmarking for Performance Masterclass: Session 2 - Data Modeling ...
ScyllaDB
 
PPTX
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Poster...
Michele Kryston
 
PDF
Cracking the Code - Unveiling Synergies Between Open Source Security and AI.pdf
Priyanka Aash
 
PDF
Hyderabad MuleSoft In-Person Meetup (June 21, 2025) Slides
Ravi Tamada
 
PDF
“MPU+: A Transformative Solution for Next-Gen AI at the Edge,” a Presentation...
Edge AI and Vision Alliance
 
PDF
How to Visualize the ​Spatio-Temporal Data Using CesiumJS​
SANGHEE SHIN
 
PDF
FME as an Orchestration Tool with Principles From Data Gravity
Safe Software
 
PDF
Darley - FIRST Copenhagen Lightning Talk (2025-06-26) Epochalypse 2038 - Time...
treyka
 
PDF
“Scaling i.MX Applications Processors’ Native Edge AI with Discrete AI Accele...
Edge AI and Vision Alliance
 
PPTX
Paycifi - Programmable Trust_Breakfast_PPTXT
FinTech Belgium
 
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Pitch ...
Michele Kryston
 
Kubernetes - Architecture & Components.pdf
geethak285
 
Practical Applications of AI in Local Government
OnBoard
 
Enabling the Digital Artisan – keynote at ICOCI 2025
Alan Dix
 
Why aren't you using FME Flow's CPU Time?
Safe Software
 
Usergroup - OutSystems Architecture.ppsx
Kurt Vandevelde
 
Optimizing the trajectory of a wheel loader working in short loading cycles
Reno Filla
 
ArcGIS Utility Network Migration - The Hunter Water Story
Safe Software
 
Automating the Geo-Referencing of Historic Aerial Photography in Flanders
Safe Software
 
Open Source Milvus Vector Database v 2.6
Zilliz
 
Database Benchmarking for Performance Masterclass: Session 2 - Data Modeling ...
ScyllaDB
 
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Poster...
Michele Kryston
 
Cracking the Code - Unveiling Synergies Between Open Source Security and AI.pdf
Priyanka Aash
 
Hyderabad MuleSoft In-Person Meetup (June 21, 2025) Slides
Ravi Tamada
 
“MPU+: A Transformative Solution for Next-Gen AI at the Edge,” a Presentation...
Edge AI and Vision Alliance
 
How to Visualize the ​Spatio-Temporal Data Using CesiumJS​
SANGHEE SHIN
 
FME as an Orchestration Tool with Principles From Data Gravity
Safe Software
 
Darley - FIRST Copenhagen Lightning Talk (2025-06-26) Epochalypse 2038 - Time...
treyka
 
“Scaling i.MX Applications Processors’ Native Edge AI with Discrete AI Accele...
Edge AI and Vision Alliance
 
Paycifi - Programmable Trust_Breakfast_PPTXT
FinTech Belgium
 

9. pointer, pointer & function

  • 2. 2 Pointer Declaration and Assignment  Variables and address – Structure of Memory – Each variable is placed in a specified address • Pointer: Address of variables … 1000 ‘a’ 1001 3.2 1005 4 … ch, 1bytes f, 4bytes i, 4bytes char ch = ‘a’ ; float f = 3.2 ; int i = 4 ; address
  • 3. 3 Pointer Declaration and Assignment  Variables and address – We can get pointers of variables from the variables char ch = ‘a’ ; float f = 3.2 ; int i = 4 ; printf( “%d %d %dn”, &a, &f, &i ) ; &(name of variable) == address of variable … 1000 ‘a’ 1001 3.2 1005 4 … Address of operator
  • 4. 4 Pointer Declaration and Assignment  Variables and address – We can access the variable with the pointer of the variable char ch ; float f ; int i ; *(&ch) = ‘a’ ; *(&f) = 3.2 ; *(&i) = 4 ; *(address) means the variable in the address … 1000 ‘a’ 1001 3.2 1005 4 … char ch ; float f ; int i ; ch = ‘a’ ; f = 3.2 ; i = 4 ; Indirect operator
  • 5. 5 Pointer Declaration and Assignment  Pointer Variable – The variable which can hold addresses of variables char ch = ‘a’ ; float f = 3.2 ; int i = 4 ; char *pch ; float *pf ; int *pi ; pch = &ch ; pf = &f ; pi = &i ; printf( “%d %d %dn”, pch, pf, pi ) ; data_type * pointer_varaible; Variable can hold only ‘char’ type pointer Variable can hold only ‘float’ type pointer Variable can hold only ‘int’ type pointer char *pch = &ch ; float *pf = &f ; int *pi = &i ;
  • 6. 6 Pointer Declaration and Assignment  Pointer Variable char ch ; float f ; int i ; ch = ‘a’ ; f = 3.2 ; i = 4 ; char ch ; float f ; int i ; char *pch = &ch ; float *pf = &f ; int *pi = &i ; *pch = ‘a’ ; *pf = 3.2 ; *pi = 4 ; … 1000 ‘a’ 1001 3.2 1005 4 …
  • 7. 7 Pointer Declaration and Assignment  Pointer Variable – The size of all pointer variables is 4 bytes (4 byte machine) • why?? char *pch ; float *pf ; int *pi ; printf( “%dn”, sizeof(pch) ) ; printf( “%dn”, sizeof(pf) ) ; printf( “%dn”, sizeof(pi) ) ; int i = 0 ; int *pi = & i; printf( “%dn”, i ) ; printf( “%dn”, *pi ) ; printf( “%dn”, &pi ) ;
  • 8. 8 Pointer Declaration and Assignment  Pointer Variable – Since a pointer variable is also a variable, it has it own address, like other variables do int i = 0 ; int *pi = &i; printf( “%dn”, i ) ; printf( “%dn”, *pi ) ; printf( “%dn”, &pi ) ; 1000 … 1020 … pi, 4 bytes i, 4 bytes
  • 9.  Example 9 Pointer Declaration and Assignment [Ex] int *p; int month=3; p = &month; Assign the address of ‘month’ to pointer variable p month 3 p 1000 month 31000 Use an arrow instead of writing address in a pointer variable
  • 10.  Example 10 Addressing and Dereferencing [Ex] int a, b; int *p; a = b = 7; p = &a; printf(“*p = %dn”, *p); *p = 3; printf(“a = %dn”, a); *p == 7 The variable pointed by p, that is a The variable pointed by p, a, has 3 assign the address of a to p *p = 7 a = 3
  • 11. 11 Addressing and Dereferencing [Ex1] int a, b; int *p; a = b = 7; p = &a; *p = 3; p = &b; *p = 2 * *p – a; pa 7 b 7 p 3 a b 7 pa 3 11 b  Example
  • 12.  Prone to error 12 Addressing and Dereferencing [Ex1] int x, *p; x = 10; *p = x; [Ex3] int x, *p; x = 10; p = x; Error!! Can’t assign value x to pointer p because p is not initialized. We don’t know where p points Error!! Can’t assign value x to pointer p because p cannot hold an integer variable
  • 13. 13 Multi Pointer Variable  Multi Pointer Variable – i is a integer variable – p is a pointer can hold the address of an integer variable – q is a pointer can hold the address of a pointer variable of integer variables • The size of pointer variable q is 4 byte (32bit machine) int i = 4 ; int *p ; int **q ;
  • 14.  Example 14 Pointer Declaration and Assignment [Ex] int i = 3; int *p ; int **q ; p = &i ; q = &p ; p i 3 i 31000 p 10002000 q 20003000 q
  • 15.  Example: – What are the values of i and j, respectively? – Assume that the addresses of i, j, p and q are 1000, 2000, 3000 and 4000, respectively. – What are the values of p, q, r? 15 Pointer Declaration and Assignment [Ex] int i = 3, j = 2; int *p, *q ; int **r ; p = &i ; q = &j ; r = &p ; *p = 4 ; *q = 5 ; **r = 6 ; *r = &q ; q =&i ; **r = 7 ;
  • 16.  Example 16 Swap Function [Ex] void swap(int i, int j) { int temp = i ; i = j; j = temp; } int main(void) { int a=3, b=7; printf(“before swap : %d %dn”, a, b); swap( a, b ); printf(“after swap : %d %dn”, a, b); } Can it swap values of a and b?
  • 17.  Example 17 Swap Function [Ex] void swap(int *p, int *q) { int temp = *p ; *p = *q; *q = temp; } int main(void) { int a=3, b=7; printf(“before swap : %d %dn”, a, b); swap(&a, &b); printf(“after swap : %d %dn”, a, b); } before swap : 3 7 after swap : 7 3
  • 18.  Swap values of two pointer variables 18 Swap Function [Ex] void swap(int **pp, int **qq) { int *temp = *pp ; *pp = *qq; *qq = temp; } int main(void) { int a=3, b=7; int *p = &a, *q = &b ; printf(“before swap : %d %dn”, *p, *q); swap(&p, &q); printf(“after swap : %d %dn”, *p, *q); } before swap : 3 7 after swap : 7 3
  • 19. 19 Call-by-Value 1 1 a in main a in function main() function function() function a = a + 1 ; When function(a); is called, value of a in main is copied to a in function 2 After Return; 1 Variable a in main and a in function are not identical, so that value of a in main is not changed 1
  • 20. 20 Call-by-Value 1 1 a in main a in function main() function function() function a = a + 1 ; When function(a); is called, value of a in main is copied to a in function 2 After Return; 1 Variable a in main and a in function are not identical, so that value of a in main is not changed 1