SlidePub
Home
Categories
Login
Register
Home
General
Expanded_Pointers_in_C12121212221212.pptx
Expanded_Pointers_in_C12121212221212.pptx
KamranKiyani5
5 views
12 slides
Sep 01, 2025
Slide
1
of 12
Previous
Next
1
2
3
4
5
6
7
8
9
10
11
12
About This Presentation
www
Size:
37.34 KB
Language:
en
Added:
Sep 01, 2025
Slides:
12 pages
Slide Content
Slide 1
Pointers in C Principles of Computer Science
Slide 2
What is a Pointer? • A variable that stores the address of another variable. • Example: int *p;
Slide 3
Why Use Pointers? • Efficient memory usage • Allows dynamic data structures • Enables call by reference
Slide 4
Declaring and Initializing Pointers • int a=5; int *p=&a; • printf("%d", *p); // prints 5
Slide 5
Pointer Operators • &: Address-of operator • *: Dereference operator
Slide 6
Example Program #include <stdio.h> int main(){ int a=10; int *p=&a; printf("Value: %d", *p); return 0; }
Slide 7
Pointers and Arrays • Array name acts as a pointer. • Example: int A[5]; int *p=A; printf("%d", *(p+2));
Slide 8
Pointer Arithmetic • Increment/decrement pointers • Example: for(p=A;p<A+5;p++) printf("%d", *p);
Slide 9
Pointers and Functions • Call by Reference using pointers • Example: swap(&a,&b);
Slide 10
Dynamic Memory Allocation • malloc, calloc, realloc, free • Example: int *p=malloc(5*sizeof(int));
Slide 11
Pointers to Strings • char *str = "Hello"; • Pointer to first character of string.
Slide 12
Best Practices with Pointers • Always initialize pointers (use NULL) • Free memory after use • Avoid dangling pointers
Tags
Categories
General
Download
Download Slideshow
Get the original presentation file
Quick Actions
Embed
Share
Save
Print
Full
Report
Statistics
Views
5
Slides
12
Age
90 days
Related Slideshows
22
Pray For The Peace Of Jerusalem and You Will Prosper
RodolfoMoralesMarcuc
30 views
26
Don_t_Waste_Your_Life_God.....powerpoint
chalobrido8
32 views
31
VILLASUR_FACTORS_TO_CONSIDER_IN_PLATING_SALAD_10-13.pdf
JaiJai148317
30 views
14
Fertility awareness methods for women in the society
Isaiah47
28 views
35
Chapter 5 Arithmetic Functions Computer Organisation and Architecture
RitikSharma297999
26 views
5
syakira bhasa inggris (1) (1).pptx.......
ourcommunity56
28 views
View More in This Category
Embed Slideshow
Dimensions
Width (px)
Height (px)
Start Page
Which slide to start from (1-12)
Options
Auto-play slides
Show controls
Embed Code
Copy Code
Share Slideshow
Share on Social Media
Share on Facebook
Share on Twitter
Share on LinkedIn
Share via Email
Or copy link
Copy
Report Content
Reason for reporting
*
Select a reason...
Inappropriate content
Copyright violation
Spam or misleading
Offensive or hateful
Privacy violation
Other
Slide number
Leave blank if it applies to the entire slideshow
Additional details
*
Help us understand the problem better