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