際際滷

際際滷Share a Scribd company logo
Introduction ttoo PPrrooggrraammmmiinngg 
LLeeccttuurree 3300
In TTooddaayyss LLeeccttuurree 
 References 
 DDiiffffeerreenncceess 
BBeettwweeeenn RReeffeerreenncceess 
aanndd PPooiinntteerrss
RReeffeerreennccee
&&
iinntt && ii ;; ii iiss aa rreeffeerreennccee ttoo aann iinntteeggeerr 
iinntt ** ii ;; ii iiss aa ppooiinntteerr ttoo aann iinntteeggeerr
iinntt ii ;; 
iinntt && jj == ii ;;
EExxaammppllee 
mmaaiinn ( ) 11 
{{ 
iinntt ii ;; 
iinntt && jj == ii ;; 
ii == 112233 ;; OOuuttppuutt 
ccoouutt <<<< ii <<<< eennddll ;; 112233 
ccoouutt <<<< jj <<<< eennddll ;; 112233 
ii++++ ;; 
ccoouutt <<<< ii <<<< eennddll ;; 112244 
ccoouutt <<<< jj ;; 112244 
}}
EExxaammppllee 22 
vvooiidd sswwaapp (( iinntt xx ,, iinntt 
yy )) 
{{ 
iinntt tteemmpp == xx ;; 
xx == yy ;; 
yy == tteemmpp ;; 
}}
EExxaammppllee 22 
mmaaiinn (( )) 
{{ 
iinntt xx ,, yy ;; 
xx == 1100 ;; 
yy == 2200 ;; 
sswwaapp (( xx ,, yy )) ;; 
ccoouutt <<<< xx <<<< yy ;; 
}}
EExxaammppllee 22 
mmaaiinn (( )) 
{{ 
iinntt xx ,, yy ;; 
xx == 1100 ;; yy == 2200 ;; 
sswwaapp (( && xx ,, && yy )) ;; 
ccoouutt <<<< xx <<<< yy ;; 
}}
swap (( iinntt ** ii ,, iinntt ** 
jj )) ;;
EExxaammppllee 22 
void swap ( iinntt ** ii ,, iinntt ** jj )) 
{{ 
iinntt ** tteemmpp == ii ;; 
** ii == ** jj ;; 
** jj == ** tteemmpp ;; 
}}
EExxaammppllee 33 
void swap ( iinntt && ii ,, iinntt && jj )) 
{{ 
iinntt tteemmpp == ii ;; 
ii == jj ;; 
jj == tteemmpp ;; 
}}
EExxaammppllee 33 
mmaaiinn (( )) 
{{ 
iinntt xx ,, yy ;; 
xx == 1100 ;; 
yy == 2200 ;; 
sswwaapp (( xx ,, yy )) ;; 
ccoouutt <<<< xx <<<< yy ;; 
}}
ccoonnsstt
EExxaammppllee 44 
ssttrruucctt bb 
{{ 
iinntt sseerrnnoo ;; 
cchhaarr tteexxtt [[ 11000000 ]] ;; //// AA lloott ooff cchhaarrss 
}} bb == {{ 112233,, "TThhiiss iiss aa BBIIGG ssttrruuccttuurree" }} ;; 
vvooiidd vvaallffuunncc (( bb )) ;; //// CCaallll bbyy vvaalluuee 
vvooiidd ppttrrffuunncc (( ** bb )) ;; //// CCaallll bbyy ppooiinntteerr 
vvooiidd rreeffffuunncc (( && bb )) ;; //// CCaallll bbyy rreeffeerreennccee
EExxaammppllee 44 
vvooiidd mmaaiinn (( )) 
{{ 
vvaallffuunncc (( bb )) ;; //// PPaassssiinngg tthhee vvaarriiaabbllee iittsseellff 
ppttrrffuunncc (( && bb )) ;; //// PPaassssiinngg tthhee aaddddrreessss ooff tthhee vvaarriiaabbllee 
rreeffffuunncc (( bb )) ;; //// PPaassssiinngg aa rreeffeerreennccee ttoo tthhee vvaarriiaabbllee 
}}
EExxaammppllee 44 
ssttrruucctt bb 
{{ 
iinntt sseerrnnoo ;; 
cchhaarr tteexxtt [[ 11000000 ]] ;; //// AA lloott ooff cchhaarrss 
}} bb == {{ 112233 ,, "TThhiiss iiss aa BBIIGG ssttrruuccttuurree" }} ;; 
vvooiidd vvaallffuunncc (( bb )) ;; //// CCaallll bbyy vvaalluuee 
vvooiidd ppttrrffuunncc (( ccoonnsstt ** bb )) ;; //// CCaallll bbyy ppooiinntteerr 
vvooiidd rreeffffuunncc (( ccoonnsstt && bb )) ;; //// CCaallll bbyy rreeffeerreennccee
Difference BBeettwweeeenn 
RReeffeerreenncceess aanndd 
PPooiinntteerrss
mmaaiinn (( )) 
{{ 
iinntt ii ;; 
iinntt && rreeffii == ii ;; 
ccoouutt <<<< TThhee aaddddrreessss ooff tthhee 
rreeffeerreennccee iiss  <<<< && 
rreeffii ;; 
ccoouutt <<<< && ii ;; 
}}
DDaanngglliinngg 
RReeffeerreenncc 
ee
References aass RReettuurrnn 
iinntt mmyynnuumm == 00 ;; ///V/V GGaalloolbbluuaall eevvaassrriiaabbllee 
iinntt && nnuumm (( )) 
{{ 
rreettuurrnn mmyynnuumm ;; 
}} 
vvooiidd mmaaiinn (( )) 
{{ 
iinntt ii ;; 
mmyynnuumm == 110000 ;; 
ii == nnuumm (( )) ;; 
nnuumm (( )) == 220000 ;; 
}}
iinntt && ii ;; 
ddoouubbllee && ff ;; 
cchhaarr && cc ;;
aa == bb == cc ;;
aa == bb ;;
cout << TThhee vvaalluueess ooff tthhee 
iinntteeggeerr iiss <<<< ii <<<< eennddll ;;
Ad

Recommended

CS201- Introduction to Programming- Lecture 26
CS201- Introduction to Programming- Lecture 26
Bilal Ahmed
CS201- Introduction to Programming- Lecture 27
CS201- Introduction to Programming- Lecture 27
Bilal Ahmed
CS201- Introduction to Programming- Lecture 40
CS201- Introduction to Programming- Lecture 40
Bilal Ahmed
CS201- Introduction to Programming- Lecture 37
CS201- Introduction to Programming- Lecture 37
Bilal Ahmed
CS201- Introduction to Programming- Lecture 07
CS201- Introduction to Programming- Lecture 07
Bilal Ahmed
CS201- Introduction to Programming- Lecture 10
CS201- Introduction to Programming- Lecture 10
Bilal Ahmed
CS201- Introduction to Programming- Lecture 03
CS201- Introduction to Programming- Lecture 03
Bilal Ahmed
Tiro parab坦lico
Tiro parab坦lico
Meli Aguilera
CS201- Introduction to Programming- Lecture 21
CS201- Introduction to Programming- Lecture 21
Bilal Ahmed
CS201- Introduction to Programming- Lecture 12
CS201- Introduction to Programming- Lecture 12
Bilal Ahmed
CS201- Introduction to Programming- Lecture 29
CS201- Introduction to Programming- Lecture 29
Bilal Ahmed
CS201- Introduction to Programming- Lecture 15
CS201- Introduction to Programming- Lecture 15
Bilal Ahmed
CS201- Introduction to Programming- Lecture 09
CS201- Introduction to Programming- Lecture 09
Bilal Ahmed
Termoqu鱈mica - Setor Leste
Termoqu鱈mica - Setor Leste
MarianaMartinsR
Perangkat Keras Hardware
Perangkat Keras Hardware
Johan19931106
Perangkat keras komputer
Perangkat keras komputer
dimasaryasetiawan
Hardware
Hardware
beneathz
pengenalan perangkat keras komputer
pengenalan perangkat keras komputer
zee120196
Potential and kinetic energy
Potential and kinetic energy
Yash Chopra
CS201- Introduction to Programming- Lecture 34
CS201- Introduction to Programming- Lecture 34
Bilal Ahmed
anatomy of the larynx
anatomy of the larynx
Pave Medicine
CS201- Introduction to Programming- Lecture 36
CS201- Introduction to Programming- Lecture 36
Bilal Ahmed
CS201- Introduction to Programming- Lecture 14
CS201- Introduction to Programming- Lecture 14
Bilal Ahmed
Government resources
Government resources
Katie Avery
Le Black's Law Dictionary, monument de la lexicographie juridique - ATA 2010
Le Black's Law Dictionary, monument de la lexicographie juridique - ATA 2010
Fr辿d辿ric Houbert
CS201- Introduction to Programming- Lecture 25
CS201- Introduction to Programming- Lecture 25
Bilal Ahmed
CS201- Introduction to Programming- Lecture 44
CS201- Introduction to Programming- Lecture 44
Bilal Ahmed
CS101- Introduction to Computing- Lecture 45
CS101- Introduction to Computing- Lecture 45
Bilal Ahmed
CS201- Introduction to Programming- Lecture 42
CS201- Introduction to Programming- Lecture 42
Bilal Ahmed

More Related Content

What's hot (19)

CS201- Introduction to Programming- Lecture 21
CS201- Introduction to Programming- Lecture 21
Bilal Ahmed
CS201- Introduction to Programming- Lecture 12
CS201- Introduction to Programming- Lecture 12
Bilal Ahmed
CS201- Introduction to Programming- Lecture 29
CS201- Introduction to Programming- Lecture 29
Bilal Ahmed
CS201- Introduction to Programming- Lecture 15
CS201- Introduction to Programming- Lecture 15
Bilal Ahmed
CS201- Introduction to Programming- Lecture 09
CS201- Introduction to Programming- Lecture 09
Bilal Ahmed
Termoqu鱈mica - Setor Leste
Termoqu鱈mica - Setor Leste
MarianaMartinsR
Perangkat Keras Hardware
Perangkat Keras Hardware
Johan19931106
Perangkat keras komputer
Perangkat keras komputer
dimasaryasetiawan
Hardware
Hardware
beneathz
pengenalan perangkat keras komputer
pengenalan perangkat keras komputer
zee120196
Potential and kinetic energy
Potential and kinetic energy
Yash Chopra
CS201- Introduction to Programming- Lecture 34
CS201- Introduction to Programming- Lecture 34
Bilal Ahmed
anatomy of the larynx
anatomy of the larynx
Pave Medicine
CS201- Introduction to Programming- Lecture 36
CS201- Introduction to Programming- Lecture 36
Bilal Ahmed
CS201- Introduction to Programming- Lecture 14
CS201- Introduction to Programming- Lecture 14
Bilal Ahmed
Government resources
Government resources
Katie Avery
Le Black's Law Dictionary, monument de la lexicographie juridique - ATA 2010
Le Black's Law Dictionary, monument de la lexicographie juridique - ATA 2010
Fr辿d辿ric Houbert
CS201- Introduction to Programming- Lecture 25
CS201- Introduction to Programming- Lecture 25
Bilal Ahmed
CS201- Introduction to Programming- Lecture 21
CS201- Introduction to Programming- Lecture 21
Bilal Ahmed
CS201- Introduction to Programming- Lecture 12
CS201- Introduction to Programming- Lecture 12
Bilal Ahmed
CS201- Introduction to Programming- Lecture 29
CS201- Introduction to Programming- Lecture 29
Bilal Ahmed
CS201- Introduction to Programming- Lecture 15
CS201- Introduction to Programming- Lecture 15
Bilal Ahmed
CS201- Introduction to Programming- Lecture 09
CS201- Introduction to Programming- Lecture 09
Bilal Ahmed
Termoqu鱈mica - Setor Leste
Termoqu鱈mica - Setor Leste
MarianaMartinsR
Perangkat Keras Hardware
Perangkat Keras Hardware
Johan19931106
Hardware
Hardware
beneathz
pengenalan perangkat keras komputer
pengenalan perangkat keras komputer
zee120196
Potential and kinetic energy
Potential and kinetic energy
Yash Chopra
CS201- Introduction to Programming- Lecture 34
CS201- Introduction to Programming- Lecture 34
Bilal Ahmed
anatomy of the larynx
anatomy of the larynx
Pave Medicine
CS201- Introduction to Programming- Lecture 36
CS201- Introduction to Programming- Lecture 36
Bilal Ahmed
CS201- Introduction to Programming- Lecture 14
CS201- Introduction to Programming- Lecture 14
Bilal Ahmed
Government resources
Government resources
Katie Avery
Le Black's Law Dictionary, monument de la lexicographie juridique - ATA 2010
Le Black's Law Dictionary, monument de la lexicographie juridique - ATA 2010
Fr辿d辿ric Houbert
CS201- Introduction to Programming- Lecture 25
CS201- Introduction to Programming- Lecture 25
Bilal Ahmed

Viewers also liked (19)

CS201- Introduction to Programming- Lecture 44
CS201- Introduction to Programming- Lecture 44
Bilal Ahmed
CS101- Introduction to Computing- Lecture 45
CS101- Introduction to Computing- Lecture 45
Bilal Ahmed
CS201- Introduction to Programming- Lecture 42
CS201- Introduction to Programming- Lecture 42
Bilal Ahmed
ENG101- English Comprehension- Lecture 38
ENG101- English Comprehension- Lecture 38
Bilal Ahmed
CS101- Introduction to Computing- Lecture 25
CS101- Introduction to Computing- Lecture 25
Bilal Ahmed
MGT101 - Financial Accounting- Lecture 35
MGT101 - Financial Accounting- Lecture 35
Bilal Ahmed
MGT101 - Financial Accounting- Lecture 32
MGT101 - Financial Accounting- Lecture 32
Bilal Ahmed
MGT101 - Financial Accounting- Lecture 23
MGT101 - Financial Accounting- Lecture 23
Bilal Ahmed
CS101- Introduction to Computing- Lecture 36
CS101- Introduction to Computing- Lecture 36
Bilal Ahmed
ENG101- English Comprehension- Lecture 26
ENG101- English Comprehension- Lecture 26
Bilal Ahmed
CS201- Introduction to Programming- Lecture 17
CS201- Introduction to Programming- Lecture 17
Bilal Ahmed
CS201- Introduction to Programming- Lecture 41
CS201- Introduction to Programming- Lecture 41
Bilal Ahmed
CS101- Introduction to Computing- Lecture 28
CS101- Introduction to Computing- Lecture 28
Bilal Ahmed
Making information easy for voters
Making information easy for voters
Center for Civic Design
Lesson 1
Lesson 1
Universidad San Ignacio de Loyola
Irr verbs21 2_sl
Irr verbs21 2_sl
Karim Babni
Designing for the Voter Experience: Learning from Voters
Designing for the Voter Experience: Learning from Voters
Center for Civic Design
Ensayo sobre la ceguera jos辿 saramago
Catalina Meneses
WhatsApp
Alberto Tico
CS201- Introduction to Programming- Lecture 44
CS201- Introduction to Programming- Lecture 44
Bilal Ahmed
CS101- Introduction to Computing- Lecture 45
CS101- Introduction to Computing- Lecture 45
Bilal Ahmed
CS201- Introduction to Programming- Lecture 42
CS201- Introduction to Programming- Lecture 42
Bilal Ahmed
ENG101- English Comprehension- Lecture 38
ENG101- English Comprehension- Lecture 38
Bilal Ahmed
CS101- Introduction to Computing- Lecture 25
CS101- Introduction to Computing- Lecture 25
Bilal Ahmed
MGT101 - Financial Accounting- Lecture 35
MGT101 - Financial Accounting- Lecture 35
Bilal Ahmed
MGT101 - Financial Accounting- Lecture 32
MGT101 - Financial Accounting- Lecture 32
Bilal Ahmed
MGT101 - Financial Accounting- Lecture 23
MGT101 - Financial Accounting- Lecture 23
Bilal Ahmed
CS101- Introduction to Computing- Lecture 36
CS101- Introduction to Computing- Lecture 36
Bilal Ahmed
ENG101- English Comprehension- Lecture 26
ENG101- English Comprehension- Lecture 26
Bilal Ahmed
CS201- Introduction to Programming- Lecture 17
CS201- Introduction to Programming- Lecture 17
Bilal Ahmed
CS201- Introduction to Programming- Lecture 41
CS201- Introduction to Programming- Lecture 41
Bilal Ahmed
CS101- Introduction to Computing- Lecture 28
CS101- Introduction to Computing- Lecture 28
Bilal Ahmed
Irr verbs21 2_sl
Irr verbs21 2_sl
Karim Babni
Designing for the Voter Experience: Learning from Voters
Designing for the Voter Experience: Learning from Voters
Center for Civic Design
Ensayo sobre la ceguera jos辿 saramago
Catalina Meneses
WhatsApp
Alberto Tico
Ad

Similar to CS201- Introduction to Programming- Lecture 30 (20)

CS201- Introduction to Programming- Lecture 20
CS201- Introduction to Programming- Lecture 20
Bilal Ahmed
CS201- Introduction to Programming- Lecture 08
CS201- Introduction to Programming- Lecture 08
Bilal Ahmed
CS201- Introduction to Programming- Lecture 24
CS201- Introduction to Programming- Lecture 24
Bilal Ahmed
CS201- Introduction to Programming- Lecture 22
CS201- Introduction to Programming- Lecture 22
Bilal Ahmed
CS201- Introduction to Programming- Lecture 38
CS201- Introduction to Programming- Lecture 38
Bilal Ahmed
CS201- Introduction to Programming- Lecture 28
CS201- Introduction to Programming- Lecture 28
Bilal Ahmed
CS201- Introduction to Programming- Lecture 33
CS201- Introduction to Programming- Lecture 33
Bilal Ahmed
CS201- Introduction to Programming- Lecture 16
CS201- Introduction to Programming- Lecture 16
Bilal Ahmed
CS201- Introduction to Programming- Lecture 11
CS201- Introduction to Programming- Lecture 11
Bilal Ahmed
CS201- Introduction to Programming- Lecture 23
CS201- Introduction to Programming- Lecture 23
Bilal Ahmed
CS201- Introduction to Programming- Lecture 04
CS201- Introduction to Programming- Lecture 04
Bilal Ahmed
CS201- Introduction to Programming- Lecture 39
CS201- Introduction to Programming- Lecture 39
Bilal Ahmed
CS201- Introduction to Programming- Lecture 19
CS201- Introduction to Programming- Lecture 19
Bilal Ahmed
CS201- Introduction to Programming- Lecture 35
CS201- Introduction to Programming- Lecture 35
Bilal Ahmed
Software engineering
Software engineering
Odin Onyenk
CS201- Introduction to Programming- Lecture 32
CS201- Introduction to Programming- Lecture 32
Bilal Ahmed
CS201- Introduction to Programming- Lecture 13
CS201- Introduction to Programming- Lecture 13
Bilal Ahmed
CS201- Introduction to Programming- Lecture 05
CS201- Introduction to Programming- Lecture 05
Bilal Ahmed
CS201- Introduction to Programming- Lecture 45
CS201- Introduction to Programming- Lecture 45
Bilal Ahmed
Mba ebooks
Mba ebooks
Edhole.com
CS201- Introduction to Programming- Lecture 20
CS201- Introduction to Programming- Lecture 20
Bilal Ahmed
CS201- Introduction to Programming- Lecture 08
CS201- Introduction to Programming- Lecture 08
Bilal Ahmed
CS201- Introduction to Programming- Lecture 24
CS201- Introduction to Programming- Lecture 24
Bilal Ahmed
CS201- Introduction to Programming- Lecture 22
CS201- Introduction to Programming- Lecture 22
Bilal Ahmed
CS201- Introduction to Programming- Lecture 38
CS201- Introduction to Programming- Lecture 38
Bilal Ahmed
CS201- Introduction to Programming- Lecture 28
CS201- Introduction to Programming- Lecture 28
Bilal Ahmed
CS201- Introduction to Programming- Lecture 33
CS201- Introduction to Programming- Lecture 33
Bilal Ahmed
CS201- Introduction to Programming- Lecture 16
CS201- Introduction to Programming- Lecture 16
Bilal Ahmed
CS201- Introduction to Programming- Lecture 11
CS201- Introduction to Programming- Lecture 11
Bilal Ahmed
CS201- Introduction to Programming- Lecture 23
CS201- Introduction to Programming- Lecture 23
Bilal Ahmed
CS201- Introduction to Programming- Lecture 04
CS201- Introduction to Programming- Lecture 04
Bilal Ahmed
CS201- Introduction to Programming- Lecture 39
CS201- Introduction to Programming- Lecture 39
Bilal Ahmed
CS201- Introduction to Programming- Lecture 19
CS201- Introduction to Programming- Lecture 19
Bilal Ahmed
CS201- Introduction to Programming- Lecture 35
CS201- Introduction to Programming- Lecture 35
Bilal Ahmed
Software engineering
Software engineering
Odin Onyenk
CS201- Introduction to Programming- Lecture 32
CS201- Introduction to Programming- Lecture 32
Bilal Ahmed
CS201- Introduction to Programming- Lecture 13
CS201- Introduction to Programming- Lecture 13
Bilal Ahmed
CS201- Introduction to Programming- Lecture 05
CS201- Introduction to Programming- Lecture 05
Bilal Ahmed
CS201- Introduction to Programming- Lecture 45
CS201- Introduction to Programming- Lecture 45
Bilal Ahmed
Ad

Recently uploaded (20)

Health Care Entities, September 2017 Aicpa
Health Care Entities, September 2017 Aicpa
onlwyslur6473
Culture Renovation: 18 Leadership Actions to Build an Unshakeable Company Kev...
Culture Renovation: 18 Leadership Actions to Build an Unshakeable Company Kev...
mwlwghg5137
Management Preliminary Edition 1st Edition Gulati Test Bank
Management Preliminary Edition 1st Edition Gulati Test Bank
kkfjsdnlz7664
Economics Today 19th Edition Miller Solutions Manual
Economics Today 19th Edition Miller Solutions Manual
wyycvzek065
Citrus Fruit Processing 1st Edition Zeki Berk
Citrus Fruit Processing 1st Edition Zeki Berk
qdxoecfp333
Chemical and Synthetic Approaches in Membrane Biology 1st Edition Arun K. Shu...
Chemical and Synthetic Approaches in Membrane Biology 1st Edition Arun K. Shu...
zbnrqgjhz369
I of the Vortex From Neurons to Self 1st Edition Rodolfo R. Llinas
I of the Vortex From Neurons to Self 1st Edition Rodolfo R. Llinas
vwsictw808
Pro Tools 9 Music Production Recording Editing And Mixing 1st Mike Collins
Pro Tools 9 Music Production Recording Editing And Mixing 1st Mike Collins
touyemlobet63
M Organizational Behavior 3rd Edition McShane Solutions Manual
M Organizational Behavior 3rd Edition McShane Solutions Manual
eaiuomw271
Solution Manual for Principles of Economics 7th Edition Mankiw 128516587X 978...
Solution Manual for Principles of Economics 7th Edition Mankiw 128516587X 978...
neryjnxvgb144
Qualitative Methods for Practice Research 1st Edition Jeffrey Longhofer
Qualitative Methods for Practice Research 1st Edition Jeffrey Longhofer
bhrigutomta72
The glycemic index: applications in practice 1st Edition Philippou
The glycemic index: applications in practice 1st Edition Philippou
vgnmbpmn837
Behaviour Monitoring and Interpretation Well being vol 9 1st Edition B. Gottf...
Behaviour Monitoring and Interpretation Well being vol 9 1st Edition B. Gottf...
wkqibvkl467
High Dynamic Range Video Concepts Technologies and Applications Alan Chalmers
High Dynamic Range Video Concepts Technologies and Applications Alan Chalmers
ucgjfxy952
Leadership Theory and Practice 6th Edition Northouse Test Bank
Leadership Theory and Practice 6th Edition Northouse Test Bank
wyycvzek065
Organizational Behavior Emerging Knowledge Global Reality 8th Edition McShane...
Organizational Behavior Emerging Knowledge Global Reality 8th Edition McShane...
wmjewbfdyc7187
MIS Essentials 4th Edition Kroenke Solutions Manual
MIS Essentials 4th Edition Kroenke Solutions Manual
oqlzcdlw439
Managing Supply Chain and Operations An Integrative Approach 1st Edition Fost...
Managing Supply Chain and Operations An Integrative Approach 1st Edition Fost...
dggkewvr8094
Supply Chain Management: A Global Perspective, 2nd Edition
Supply Chain Management: A Global Perspective, 2nd Edition
qtyigwcw2900
Electronic Noses and Tongues in Food Science 1st Edition Maria Luz Rodriguez ...
Electronic Noses and Tongues in Food Science 1st Edition Maria Luz Rodriguez ...
xxnmkkti4432
Health Care Entities, September 2017 Aicpa
Health Care Entities, September 2017 Aicpa
onlwyslur6473
Culture Renovation: 18 Leadership Actions to Build an Unshakeable Company Kev...
Culture Renovation: 18 Leadership Actions to Build an Unshakeable Company Kev...
mwlwghg5137
Management Preliminary Edition 1st Edition Gulati Test Bank
Management Preliminary Edition 1st Edition Gulati Test Bank
kkfjsdnlz7664
Economics Today 19th Edition Miller Solutions Manual
Economics Today 19th Edition Miller Solutions Manual
wyycvzek065
Citrus Fruit Processing 1st Edition Zeki Berk
Citrus Fruit Processing 1st Edition Zeki Berk
qdxoecfp333
Chemical and Synthetic Approaches in Membrane Biology 1st Edition Arun K. Shu...
Chemical and Synthetic Approaches in Membrane Biology 1st Edition Arun K. Shu...
zbnrqgjhz369
I of the Vortex From Neurons to Self 1st Edition Rodolfo R. Llinas
I of the Vortex From Neurons to Self 1st Edition Rodolfo R. Llinas
vwsictw808
Pro Tools 9 Music Production Recording Editing And Mixing 1st Mike Collins
Pro Tools 9 Music Production Recording Editing And Mixing 1st Mike Collins
touyemlobet63
M Organizational Behavior 3rd Edition McShane Solutions Manual
M Organizational Behavior 3rd Edition McShane Solutions Manual
eaiuomw271
Solution Manual for Principles of Economics 7th Edition Mankiw 128516587X 978...
Solution Manual for Principles of Economics 7th Edition Mankiw 128516587X 978...
neryjnxvgb144
Qualitative Methods for Practice Research 1st Edition Jeffrey Longhofer
Qualitative Methods for Practice Research 1st Edition Jeffrey Longhofer
bhrigutomta72
The glycemic index: applications in practice 1st Edition Philippou
The glycemic index: applications in practice 1st Edition Philippou
vgnmbpmn837
Behaviour Monitoring and Interpretation Well being vol 9 1st Edition B. Gottf...
Behaviour Monitoring and Interpretation Well being vol 9 1st Edition B. Gottf...
wkqibvkl467
High Dynamic Range Video Concepts Technologies and Applications Alan Chalmers
High Dynamic Range Video Concepts Technologies and Applications Alan Chalmers
ucgjfxy952
Leadership Theory and Practice 6th Edition Northouse Test Bank
Leadership Theory and Practice 6th Edition Northouse Test Bank
wyycvzek065
Organizational Behavior Emerging Knowledge Global Reality 8th Edition McShane...
Organizational Behavior Emerging Knowledge Global Reality 8th Edition McShane...
wmjewbfdyc7187
MIS Essentials 4th Edition Kroenke Solutions Manual
MIS Essentials 4th Edition Kroenke Solutions Manual
oqlzcdlw439
Managing Supply Chain and Operations An Integrative Approach 1st Edition Fost...
Managing Supply Chain and Operations An Integrative Approach 1st Edition Fost...
dggkewvr8094
Supply Chain Management: A Global Perspective, 2nd Edition
Supply Chain Management: A Global Perspective, 2nd Edition
qtyigwcw2900
Electronic Noses and Tongues in Food Science 1st Edition Maria Luz Rodriguez ...
Electronic Noses and Tongues in Food Science 1st Edition Maria Luz Rodriguez ...
xxnmkkti4432

CS201- Introduction to Programming- Lecture 30

  • 2. In TTooddaayyss LLeeccttuurree References DDiiffffeerreenncceess BBeettwweeeenn RReeffeerreenncceess aanndd PPooiinntteerrss
  • 4. &&
  • 5. iinntt && ii ;; ii iiss aa rreeffeerreennccee ttoo aann iinntteeggeerr iinntt ** ii ;; ii iiss aa ppooiinntteerr ttoo aann iinntteeggeerr
  • 6. iinntt ii ;; iinntt && jj == ii ;;
  • 7. EExxaammppllee mmaaiinn ( ) 11 {{ iinntt ii ;; iinntt && jj == ii ;; ii == 112233 ;; OOuuttppuutt ccoouutt <<<< ii <<<< eennddll ;; 112233 ccoouutt <<<< jj <<<< eennddll ;; 112233 ii++++ ;; ccoouutt <<<< ii <<<< eennddll ;; 112244 ccoouutt <<<< jj ;; 112244 }}
  • 8. EExxaammppllee 22 vvooiidd sswwaapp (( iinntt xx ,, iinntt yy )) {{ iinntt tteemmpp == xx ;; xx == yy ;; yy == tteemmpp ;; }}
  • 9. EExxaammppllee 22 mmaaiinn (( )) {{ iinntt xx ,, yy ;; xx == 1100 ;; yy == 2200 ;; sswwaapp (( xx ,, yy )) ;; ccoouutt <<<< xx <<<< yy ;; }}
  • 10. EExxaammppllee 22 mmaaiinn (( )) {{ iinntt xx ,, yy ;; xx == 1100 ;; yy == 2200 ;; sswwaapp (( && xx ,, && yy )) ;; ccoouutt <<<< xx <<<< yy ;; }}
  • 11. swap (( iinntt ** ii ,, iinntt ** jj )) ;;
  • 12. EExxaammppllee 22 void swap ( iinntt ** ii ,, iinntt ** jj )) {{ iinntt ** tteemmpp == ii ;; ** ii == ** jj ;; ** jj == ** tteemmpp ;; }}
  • 13. EExxaammppllee 33 void swap ( iinntt && ii ,, iinntt && jj )) {{ iinntt tteemmpp == ii ;; ii == jj ;; jj == tteemmpp ;; }}
  • 14. EExxaammppllee 33 mmaaiinn (( )) {{ iinntt xx ,, yy ;; xx == 1100 ;; yy == 2200 ;; sswwaapp (( xx ,, yy )) ;; ccoouutt <<<< xx <<<< yy ;; }}
  • 16. EExxaammppllee 44 ssttrruucctt bb {{ iinntt sseerrnnoo ;; cchhaarr tteexxtt [[ 11000000 ]] ;; //// AA lloott ooff cchhaarrss }} bb == {{ 112233,, "TThhiiss iiss aa BBIIGG ssttrruuccttuurree" }} ;; vvooiidd vvaallffuunncc (( bb )) ;; //// CCaallll bbyy vvaalluuee vvooiidd ppttrrffuunncc (( ** bb )) ;; //// CCaallll bbyy ppooiinntteerr vvooiidd rreeffffuunncc (( && bb )) ;; //// CCaallll bbyy rreeffeerreennccee
  • 17. EExxaammppllee 44 vvooiidd mmaaiinn (( )) {{ vvaallffuunncc (( bb )) ;; //// PPaassssiinngg tthhee vvaarriiaabbllee iittsseellff ppttrrffuunncc (( && bb )) ;; //// PPaassssiinngg tthhee aaddddrreessss ooff tthhee vvaarriiaabbllee rreeffffuunncc (( bb )) ;; //// PPaassssiinngg aa rreeffeerreennccee ttoo tthhee vvaarriiaabbllee }}
  • 18. EExxaammppllee 44 ssttrruucctt bb {{ iinntt sseerrnnoo ;; cchhaarr tteexxtt [[ 11000000 ]] ;; //// AA lloott ooff cchhaarrss }} bb == {{ 112233 ,, "TThhiiss iiss aa BBIIGG ssttrruuccttuurree" }} ;; vvooiidd vvaallffuunncc (( bb )) ;; //// CCaallll bbyy vvaalluuee vvooiidd ppttrrffuunncc (( ccoonnsstt ** bb )) ;; //// CCaallll bbyy ppooiinntteerr vvooiidd rreeffffuunncc (( ccoonnsstt && bb )) ;; //// CCaallll bbyy rreeffeerreennccee
  • 20. mmaaiinn (( )) {{ iinntt ii ;; iinntt && rreeffii == ii ;; ccoouutt <<<< TThhee aaddddrreessss ooff tthhee rreeffeerreennccee iiss <<<< && rreeffii ;; ccoouutt <<<< && ii ;; }}
  • 22. References aass RReettuurrnn iinntt mmyynnuumm == 00 ;; ///V/V GGaalloolbbluuaall eevvaassrriiaabbllee iinntt && nnuumm (( )) {{ rreettuurrnn mmyynnuumm ;; }} vvooiidd mmaaiinn (( )) {{ iinntt ii ;; mmyynnuumm == 110000 ;; ii == nnuumm (( )) ;; nnuumm (( )) == 220000 ;; }}
  • 23. iinntt && ii ;; ddoouubbllee && ff ;; cchhaarr && cc ;;
  • 24. aa == bb == cc ;;
  • 25. aa == bb ;;
  • 26. cout << TThhee vvaalluueess ooff tthhee iinntteeggeerr iiss <<<< ii <<<< eennddll ;;