SlideShare a Scribd company logo
Pointer in C
Md. Shafiuzzaman
Lecturer, Dept. of CSE, JUST
Address
scanf("%d", &var);
Address
#include <stdio.h>
int main()
{
int var = 5;
printf("var: %dn", var);
printf("address of var: %p", &var);
return 0;
}
var: 5
address of var: 2686778
Pointer Syntax
int *p1;
Access to Pointers
int* pc, c;
c = 5;
pc = &c;
printf("%d", *pc); // Output: 5
Access to Pointers
int* pc, c;
c = 5;
pc = &c;
c = 1;
printf("%d", c); // Output: 1
printf("%d", *pc); // Ouptut: 1
Access to Pointers
int* pc, c;
c = 5;
pc = &c;
*pc = 1;
printf("%d", *pc); // Ouptut: 1
printf("%d", c); // Output: 1
C pointers
Common mistakes when working with
pointers

More Related Content

PDF
C언어 스터디 강의자료 - 1차시
PDF
DOC
5 Rmi Print
PDF
88 c-programs
ODP
PHPUnit Myth
PPTX
Logic development
DOCX
Practical write a c program to reverse a given number
DOCX
Practical write a c program to reverse a given number
C언어 스터디 강의자료 - 1차시
5 Rmi Print
88 c-programs
PHPUnit Myth
Logic development
Practical write a c program to reverse a given number
Practical write a c program to reverse a given number

What's hot (20)

PPTX
PPTX
Compiler design lab
DOC
C program to check leap year
DOCX
Lab loop
PPTX
Program structure of c
DOCX
C Language Programs
PPTX
Simple c program
TXT
New text document
PDF
Lec14-CS110 Computational Engineering
DOC
C lab-programs
PPTX
ภาษาซีพื้นฐาน
DOCX
DOCX
C programs
DOCX
Bti1022 lab sheet 3
DOCX
Cd practical file (1) start se
PPTX
C Programming Language Part 4
PDF
1 introducing c language
PPTX
Program presentation
Compiler design lab
C program to check leap year
Lab loop
Program structure of c
C Language Programs
Simple c program
New text document
Lec14-CS110 Computational Engineering
C lab-programs
ภาษาซีพื้นฐาน
C programs
Bti1022 lab sheet 3
Cd practical file (1) start se
C Programming Language Part 4
1 introducing c language
Program presentation
Ad

More from Md. Shafiuzzaman Hira (20)

PPTX
Introduction to Web development
PPTX
Software measurement and estimation
PPTX
Why do we test software?
PPT
Software Requirements engineering
PPTX
Software architectural patterns
PPTX
Class based modeling
PPTX
Class diagram
PPTX
State diagram
PDF
Use case Modeling
PDF
User stories
PDF
Agile Methodology
PDF
Software Process Model
PDF
Introduction to Software Engineering Course
PPTX
C structures
PPTX
How to Create Python scripts
PPTX
Regular expressions using Python
PPTX
Password locker project
PPTX
Dictionaries in Python
Introduction to Web development
Software measurement and estimation
Why do we test software?
Software Requirements engineering
Software architectural patterns
Class based modeling
Class diagram
State diagram
Use case Modeling
User stories
Agile Methodology
Software Process Model
Introduction to Software Engineering Course
C structures
How to Create Python scripts
Regular expressions using Python
Password locker project
Dictionaries in Python
Ad

Recently uploaded (20)

PDF
cuic standard and advanced reporting.pdf
PDF
Encapsulation theory and applications.pdf
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
A Presentation on Artificial Intelligence
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
Cloud computing and distributed systems.
PDF
Network Security Unit 5.pdf for BCA BBA.
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Machine learning based COVID-19 study performance prediction
PDF
Approach and Philosophy of On baking technology
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
cuic standard and advanced reporting.pdf
Encapsulation theory and applications.pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
A Presentation on Artificial Intelligence
Per capita expenditure prediction using model stacking based on satellite ima...
Cloud computing and distributed systems.
Network Security Unit 5.pdf for BCA BBA.
“AI and Expert System Decision Support & Business Intelligence Systems”
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Review of recent advances in non-invasive hemoglobin estimation
Machine learning based COVID-19 study performance prediction
Approach and Philosophy of On baking technology
Diabetes mellitus diagnosis method based random forest with bat algorithm
The AUB Centre for AI in Media Proposal.docx
NewMind AI Weekly Chronicles - August'25 Week I
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Advanced methodologies resolving dimensionality complications for autism neur...
Reach Out and Touch Someone: Haptics and Empathic Computing
Chapter 3 Spatial Domain Image Processing.pdf
Agricultural_Statistics_at_a_Glance_2022_0.pdf

C pointers