Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
39 views10 pages

Pointers Functions

Uploaded by

Vince Carrillo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views10 pages

Pointers Functions

Uploaded by

Vince Carrillo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Prog 1 Tutorial

Topics
i Pointers

Intro
-

- definition
- USI

addresses
-memory
-

I initializing double
declaring
(include
-

Accessing
Striple Pointers)
-
pointer Arithmetic ( ptr + 1)
+

↑ Functions
-
Definition and use

Function Prototype
-

Function Header vs

and parameters
-

Return types
Visualization
- Execution Stack
-
pass & pass by reference
by copy
pointers and function)
between
↳ Interaction
function arguement
Passing pointers
as
-

values using pointers


in
functions
modifying
-

functions
-

Returning pointers from


to functions
-pointers
Pointer

How to Declare a Pointer


We use the symbol * to declare a pointer variable

INITIALIZING POINTERS

&
DOUBLE AND TRIPLE POINTERS
Pointer Arithmetic
Functions
Function Header VS Function Prototype
Execution Stack

Pass by copy & Pass by reference


Pass by copy
Pass by reference

# include stdio h7 .

inty) ;
int Swap Numbers (intx ,


int main()
int X = 2;

int 3;
y
=

(SX By) ;
Swap Numbers
,

% &" x (;
prints ("X
:
,

print (" Y
: % d" , y (;
return O ;

Y
(int*x inty) &
int swap Numbers ,

int temp= "X ;

* *
X =
Y
*
X =
temp

W
B
Heap

STACK
Returning pointers from functions
Returning pointers from functions

You might also like