SlideShare une entreprise Scribd logo
1  sur  65
 
Chapter 12 Separate Compilation and  Namespaces Copyright © 2008 Pearson Addison-Wesley.  All rights reserved.
Overview ,[object Object],[object Object],Slide 12-
12.1 Separate Compilation Copyright © 2008 Pearson Addison-Wesley.  All rights reserved.
Separate Compilation ,[object Object],[object Object],[object Object],[object Object],[object Object],Slide 12-
ADT Review ,[object Object],[object Object],[object Object],[object Object],Slide 12-
The ADT Interface ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Slide 12-
The ADT Implementation ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Slide 12-
Separate Files ,[object Object],[object Object],[object Object],Slide 12-
A Minor Compromise ,[object Object],[object Object],[object Object],[object Object],[object Object],Slide 12-
Case Study: DigitalTime ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Slide 12-
[object Object],[object Object],[object Object],[object Object],Naming The Interface File Slide 12-  Display 12.1
#include &quot; &quot; or < > ? ,[object Object],[object Object],[object Object],[object Object],Slide 12-
The Implementation File ,[object Object],[object Object],[object Object],[object Object],Slide 12-
[object Object],#include &quot;dtime.h&quot; Slide 12-  Display 12.2 (1) Display 12.2 (2) Display 12.2 (3) Display 12.2 (4)
[object Object],[object Object],[object Object],The Application File Slide 12-  Display 12.3
Running The Program ,[object Object],[object Object],[object Object],[object Object],[object Object],Slide 12-
Compile dtime.h ? ,[object Object],[object Object],[object Object],[object Object],[object Object],Slide 12-
Why Three Files? ,[object Object],[object Object],[object Object],[object Object],Slide 12-
Reusable Components ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Slide 12-
Multiple Classes ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Slide 12-
Introduction to  #ifndef ,[object Object],[object Object],[object Object],[object Object],Slide 12-
[object Object],[object Object],[object Object],[object Object],[object Object],Using #ifndef Slide 12-  true false
[object Object],[object Object],[object Object],[object Object],Why DTIME_H? Slide 12-  Display 12.4
Defining Libraries ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Slide 12-
Section 12.1 Conclusion ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Slide 12-
12.2 Namespaces Copyright © 2008 Pearson Addison-Wesley.  All rights reserved.
Namespaces ,[object Object],[object Object],[object Object],Slide 12-
The Using Directive ,[object Object],[object Object],Slide 12-
The Global Namespace ,[object Object],[object Object],[object Object],Slide 12-
Name Conflicts ,[object Object],[object Object],[object Object],Slide 12-  {   using namespace ns 1 ;   my_function( ); } {   using namespace ns 2 ;   my_function( ); }
Scope Rules For using ,[object Object],[object Object],[object Object],Slide 12-
Creating a Namespace ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Slide 12-
Namespaces: Declaring a Function ,[object Object],[object Object],Slide 12-
Namespaces: Defining a Function ,[object Object],[object Object],Slide 12-
[object Object],[object Object],[object Object],Namespaces: Using a Function Slide 12-  Using directive's scope Display 12.5 (1-2)
A Namespace Problem ,[object Object],[object Object],Slide 12-  namespace ns1 {   fun1( );   my_function( );  } namespace ns2 {   fun2( );   my_function( ); }
Qualifying Names ,[object Object],[object Object],[object Object],[object Object],[object Object],Slide 12-
Qualifiying Parameter Names ,[object Object],[object Object],[object Object],[object Object],Slide 12-
Directive/Declaration (Optional) ,[object Object],[object Object],Slide 12-
A Subtle Point (Optional) ,[object Object],[object Object],Slide 12-
A Subtle Point Continued ,[object Object],[object Object],Slide 12-
Unnamed Namespaces ,[object Object],[object Object],[object Object],[object Object],[object Object],Slide 12-
The unnamed grouping ,[object Object],[object Object],Slide 12-
[object Object],[object Object],[object Object],[object Object],Names In The  unnamed namespace Slide 12-  Display 12.6 Display 12.7 (1) Display 12.7 (2)
[object Object],Namespaces  In An Application Slide 12-  Display 12.8 (1) Display 12.8 (2)
Compilation Units Overlap ,[object Object],[object Object],[object Object],[object Object],[object Object],Slide 12-
Naming Namespaces ,[object Object],[object Object],[object Object],Slide 12-
Global or unnamed? ,[object Object],[object Object],[object Object],[object Object],Slide 12-
Section 12.2 Conclusion ,[object Object],[object Object],[object Object],[object Object],Slide 12-
Chapter 12 -- End Slide 12-
Display 12.1   Slide 12-  Back Next
Display 12.2 (1/4) Slide 12-  Back Next
Display 2.2 (2/4) Slide 12-  Back Next
Display 12.2 (3/4) Slide 12-  Back Next
Display 12.2 (4/4) Slide 12-  Back Next
Display 12.3 Slide 12-  Back Next
Display 12.4 Slide 12-  Back Next
Display 12.5 (1/2) Slide 12-  Back Next
Display 12.5 (2/2) Slide 12-  Back Next
Display 12.6 Slide 12-  Back Next
Display 12.7 (1/2) Slide 12-  Back Next
Display 12.7 (2/2) Slide 12-  Back Next
Display 12.8 (1/2) Slide 12-  Back Next
Display 12.8 (2/2) Slide 12-  Back Next

Contenu connexe

En vedette (17)

Savitch Ch 17
Savitch Ch 17Savitch Ch 17
Savitch Ch 17
 
Savitch Ch 15
Savitch Ch 15Savitch Ch 15
Savitch Ch 15
 
Savitch ch 04
Savitch ch 04Savitch ch 04
Savitch ch 04
 
Savitch Ch 11
Savitch Ch 11Savitch Ch 11
Savitch Ch 11
 
Savitch Ch 01
Savitch Ch 01Savitch Ch 01
Savitch Ch 01
 
Savitch Ch 13
Savitch Ch 13Savitch Ch 13
Savitch Ch 13
 
Savitch Ch 06
Savitch Ch 06Savitch Ch 06
Savitch Ch 06
 
Savitch Ch 08
Savitch Ch 08Savitch Ch 08
Savitch Ch 08
 
Savitch Ch 07
Savitch Ch 07Savitch Ch 07
Savitch Ch 07
 
Savitch Ch 10
Savitch Ch 10Savitch Ch 10
Savitch Ch 10
 
Savitch Ch 02
Savitch Ch 02Savitch Ch 02
Savitch Ch 02
 
Savitch ch 022
Savitch ch 022Savitch ch 022
Savitch ch 022
 
Savitch ch 01
Savitch ch 01Savitch ch 01
Savitch ch 01
 
Savitch Ch 14
Savitch Ch 14Savitch Ch 14
Savitch Ch 14
 
Savitch Ch 05
Savitch Ch 05Savitch Ch 05
Savitch Ch 05
 
Savitch Ch 04
Savitch Ch 04Savitch Ch 04
Savitch Ch 04
 
Functions in C++
Functions in C++Functions in C++
Functions in C++
 

Similaire à Savitch Ch 12

Android coding guide lines
Android coding guide linesAndroid coding guide lines
Android coding guide lines
lokeshG38
 
Talk on .NET assemblies
Talk on .NET assembliesTalk on .NET assemblies
Talk on .NET assemblies
Vidya Agarwal
 
Oosd lecture unit 4 ppt introduction part
Oosd lecture unit 4 ppt introduction partOosd lecture unit 4 ppt introduction part
Oosd lecture unit 4 ppt introduction part
ManuSingh669370
 
DTS s03e02 Handling the code
DTS s03e02 Handling the codeDTS s03e02 Handling the code
DTS s03e02 Handling the code
Tuenti
 
Chap 2 structure of c programming dti2143
Chap 2  structure of c programming dti2143Chap 2  structure of c programming dti2143
Chap 2 structure of c programming dti2143
alish sha
 

Similaire à Savitch Ch 12 (20)

Linux Internals Part - 2
Linux Internals Part - 2Linux Internals Part - 2
Linux Internals Part - 2
 
Android coding guide lines
Android coding guide linesAndroid coding guide lines
Android coding guide lines
 
Readme
ReadmeReadme
Readme
 
Drupal Modules
Drupal ModulesDrupal Modules
Drupal Modules
 
Synapseindia android apps introduction hello world
Synapseindia android apps introduction hello worldSynapseindia android apps introduction hello world
Synapseindia android apps introduction hello world
 
Building a Custom Theme in Drupal 8
Building a Custom Theme in Drupal 8Building a Custom Theme in Drupal 8
Building a Custom Theme in Drupal 8
 
Install
InstallInstall
Install
 
Drupal 8 - Corso frontend development
Drupal 8 - Corso frontend developmentDrupal 8 - Corso frontend development
Drupal 8 - Corso frontend development
 
6 preprocessor macro header
6 preprocessor macro header6 preprocessor macro header
6 preprocessor macro header
 
Talk on .NET assemblies
Talk on .NET assembliesTalk on .NET assemblies
Talk on .NET assemblies
 
The Render API in Drupal 7
The Render API in Drupal 7The Render API in Drupal 7
The Render API in Drupal 7
 
Industrial Training in Android Application
Industrial Training in Android ApplicationIndustrial Training in Android Application
Industrial Training in Android Application
 
Bareos - Open Source Data Protection, by Philipp Storz
Bareos - Open Source Data Protection, by Philipp StorzBareos - Open Source Data Protection, by Philipp Storz
Bareos - Open Source Data Protection, by Philipp Storz
 
Devtools cheatsheet
Devtools cheatsheetDevtools cheatsheet
Devtools cheatsheet
 
Devtools cheatsheet
Devtools cheatsheetDevtools cheatsheet
Devtools cheatsheet
 
Oosd lecture unit 4 ppt introduction part
Oosd lecture unit 4 ppt introduction partOosd lecture unit 4 ppt introduction part
Oosd lecture unit 4 ppt introduction part
 
Reproducibility with R
Reproducibility with RReproducibility with R
Reproducibility with R
 
DTS s03e02 Handling the code
DTS s03e02 Handling the codeDTS s03e02 Handling the code
DTS s03e02 Handling the code
 
R12 d49656 gc10-apps dba 09
R12 d49656 gc10-apps dba 09R12 d49656 gc10-apps dba 09
R12 d49656 gc10-apps dba 09
 
Chap 2 structure of c programming dti2143
Chap 2  structure of c programming dti2143Chap 2  structure of c programming dti2143
Chap 2 structure of c programming dti2143
 

Plus de Terry Yoast

Plus de Terry Yoast (20)

9781305078444 ppt ch12
9781305078444 ppt ch129781305078444 ppt ch12
9781305078444 ppt ch12
 
9781305078444 ppt ch11
9781305078444 ppt ch119781305078444 ppt ch11
9781305078444 ppt ch11
 
9781305078444 ppt ch10
9781305078444 ppt ch109781305078444 ppt ch10
9781305078444 ppt ch10
 
9781305078444 ppt ch09
9781305078444 ppt ch099781305078444 ppt ch09
9781305078444 ppt ch09
 
9781305078444 ppt ch08
9781305078444 ppt ch089781305078444 ppt ch08
9781305078444 ppt ch08
 
9781305078444 ppt ch07
9781305078444 ppt ch079781305078444 ppt ch07
9781305078444 ppt ch07
 
9781305078444 ppt ch06
9781305078444 ppt ch069781305078444 ppt ch06
9781305078444 ppt ch06
 
9781305078444 ppt ch05
9781305078444 ppt ch059781305078444 ppt ch05
9781305078444 ppt ch05
 
9781305078444 ppt ch04
9781305078444 ppt ch049781305078444 ppt ch04
9781305078444 ppt ch04
 
9781305078444 ppt ch03
9781305078444 ppt ch039781305078444 ppt ch03
9781305078444 ppt ch03
 
9781305078444 ppt ch02
9781305078444 ppt ch029781305078444 ppt ch02
9781305078444 ppt ch02
 
9781305078444 ppt ch01
9781305078444 ppt ch019781305078444 ppt ch01
9781305078444 ppt ch01
 
9781337102087 ppt ch13
9781337102087 ppt ch139781337102087 ppt ch13
9781337102087 ppt ch13
 
9781337102087 ppt ch18
9781337102087 ppt ch189781337102087 ppt ch18
9781337102087 ppt ch18
 
9781337102087 ppt ch17
9781337102087 ppt ch179781337102087 ppt ch17
9781337102087 ppt ch17
 
9781337102087 ppt ch16
9781337102087 ppt ch169781337102087 ppt ch16
9781337102087 ppt ch16
 
9781337102087 ppt ch15
9781337102087 ppt ch159781337102087 ppt ch15
9781337102087 ppt ch15
 
9781337102087 ppt ch14
9781337102087 ppt ch149781337102087 ppt ch14
9781337102087 ppt ch14
 
9781337102087 ppt ch12
9781337102087 ppt ch129781337102087 ppt ch12
9781337102087 ppt ch12
 
9781337102087 ppt ch11
9781337102087 ppt ch119781337102087 ppt ch11
9781337102087 ppt ch11
 

Dernier

Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
heathfieldcps1
 

Dernier (20)

Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesEnergy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 

Savitch Ch 12