SlideShare une entreprise Scribd logo
1  sur  1
Télécharger pour lire hors ligne
#include <iostream>
/**
* Test class.
*/
class Class
{
/**
* Constructor.
*/
int _id;
public:
/**
* Constructor.
*/
Class(int id = 0): _id(id)
{ std::cout << "Constructor Invocation! Id: " << _id << std::endl; };
/**
* Id Method.
*/
void id(int myid){ _id = myid;}
/**
* Run method.
*/
void run(void)
{ std::cout << "Running! Id: " << _id << std::endl; };
/**
* Destructor.
*/
virtual ~Class(void)
{ std::cout << "Destructor Invocation! Id: " << _id << std::endl;}
};
// Function with passing parameter by value
void TestFunction(Class c){ c.id(1); c.run(); };
// Function with explicit parameter passing by reference.
void TestFunction(Class* c){ c->run(); };
// Function with parameter passing by automatic dereference.
void TestFunction2(Class& c) {
c.run(); };
int main(void)
{
Class c(0);
std::cout << "n@@@" << std::endl;
TestFunction(c);
std::cout << "@@@" << "nn";
std::cout << "---" << std::endl;
TestFunction(4);
std::cout << "---" << "nn";
std::cout << "+++" << std::endl;
TestFunction(&c);
std::cout << "+++" << "nn";
std::cout << "$$$" << std::endl;
TestFunction2(c);
std::cout << "$$$" << "nn";
return 0;
}

Contenu connexe

Tendances

運用Closure Compiler 打造高品質的JavaScript
運用Closure Compiler 打造高品質的JavaScript運用Closure Compiler 打造高品質的JavaScript
運用Closure Compiler 打造高品質的JavaScripttaobao.com
 
Javascript & Ajax Basics
Javascript & Ajax BasicsJavascript & Ajax Basics
Javascript & Ajax BasicsRichard Paul
 
Javascript ES6
Javascript ES6Javascript ES6
Javascript ES6Huy Doan
 
Sonar rules in action with walkmod
Sonar rules in action with walkmodSonar rules in action with walkmod
Sonar rules in action with walkmodRaquel Pau
 
Angular 2.0 Pipes
Angular 2.0 PipesAngular 2.0 Pipes
Angular 2.0 PipesEyal Vardi
 
BarcelonaJUG2016: walkmod: how to run and design code transformations
BarcelonaJUG2016: walkmod: how to run and design code transformationsBarcelonaJUG2016: walkmod: how to run and design code transformations
BarcelonaJUG2016: walkmod: how to run and design code transformationswalkmod
 
Javascript basics for automation testing
Javascript  basics for automation testingJavascript  basics for automation testing
Javascript basics for automation testingVikas Thange
 
Checking Oracle VM VirtualBox. Part 2
Checking Oracle VM VirtualBox. Part 2Checking Oracle VM VirtualBox. Part 2
Checking Oracle VM VirtualBox. Part 2Andrey Karpov
 
Notes for xx_use_serialgc
Notes for xx_use_serialgcNotes for xx_use_serialgc
Notes for xx_use_serialgcytoshima
 

Tendances (10)

運用Closure Compiler 打造高品質的JavaScript
運用Closure Compiler 打造高品質的JavaScript運用Closure Compiler 打造高品質的JavaScript
運用Closure Compiler 打造高品質的JavaScript
 
Javascript & Ajax Basics
Javascript & Ajax BasicsJavascript & Ajax Basics
Javascript & Ajax Basics
 
Javascript ES6
Javascript ES6Javascript ES6
Javascript ES6
 
Sonar rules in action with walkmod
Sonar rules in action with walkmodSonar rules in action with walkmod
Sonar rules in action with walkmod
 
Angular 2.0 Pipes
Angular 2.0 PipesAngular 2.0 Pipes
Angular 2.0 Pipes
 
BarcelonaJUG2016: walkmod: how to run and design code transformations
BarcelonaJUG2016: walkmod: how to run and design code transformationsBarcelonaJUG2016: walkmod: how to run and design code transformations
BarcelonaJUG2016: walkmod: how to run and design code transformations
 
Javascript basics for automation testing
Javascript  basics for automation testingJavascript  basics for automation testing
Javascript basics for automation testing
 
Checking Oracle VM VirtualBox. Part 2
Checking Oracle VM VirtualBox. Part 2Checking Oracle VM VirtualBox. Part 2
Checking Oracle VM VirtualBox. Part 2
 
Notes for xx_use_serialgc
Notes for xx_use_serialgcNotes for xx_use_serialgc
Notes for xx_use_serialgc
 
Unit testing concurrent code
Unit testing concurrent codeUnit testing concurrent code
Unit testing concurrent code
 

En vedette

Documentation - Reference Manual - SysSorting
Documentation - Reference Manual - SysSortingDocumentation - Reference Manual - SysSorting
Documentation - Reference Manual - SysSortingMichel Alves
 
Intelligent Transfer of Thematic Harmonic Color Palettes
Intelligent Transfer of Thematic Harmonic Color PalettesIntelligent Transfer of Thematic Harmonic Color Palettes
Intelligent Transfer of Thematic Harmonic Color PalettesMichel Alves
 
A Framework for Harmonic Color Measures
A Framework for Harmonic Color MeasuresA Framework for Harmonic Color Measures
A Framework for Harmonic Color MeasuresMichel Alves
 
Texture Synthesis: An Approach Based on GPU Use
Texture Synthesis: An Approach Based on GPU UseTexture Synthesis: An Approach Based on GPU Use
Texture Synthesis: An Approach Based on GPU UseMichel Alves
 
Effectiveness of Image Quality Assessment Indexes
Effectiveness of Image Quality Assessment IndexesEffectiveness of Image Quality Assessment Indexes
Effectiveness of Image Quality Assessment IndexesMichel Alves
 
Introduction to Kernel Functions
Introduction to Kernel FunctionsIntroduction to Kernel Functions
Introduction to Kernel FunctionsMichel Alves
 
Graph Theory - Exercises - Chapter 2 - Part II
Graph Theory - Exercises - Chapter 2 - Part IIGraph Theory - Exercises - Chapter 2 - Part II
Graph Theory - Exercises - Chapter 2 - Part IIMichel Alves
 
Report - Lex and YACC
Report -  Lex and YACCReport -  Lex and YACC
Report - Lex and YACCMichel Alves
 
ID3 Algorithm - Reference Manual
ID3 Algorithm - Reference ManualID3 Algorithm - Reference Manual
ID3 Algorithm - Reference ManualMichel Alves
 
Graph Theory - Exercises - Chapter 3 - Algorithms of Dijkstra and Bellman-Ford
Graph Theory - Exercises - Chapter 3 - Algorithms of Dijkstra and Bellman-FordGraph Theory - Exercises - Chapter 3 - Algorithms of Dijkstra and Bellman-Ford
Graph Theory - Exercises - Chapter 3 - Algorithms of Dijkstra and Bellman-FordMichel Alves
 
Graph Theory - Exercises - Chapter 3
Graph Theory - Exercises - Chapter 3Graph Theory - Exercises - Chapter 3
Graph Theory - Exercises - Chapter 3Michel Alves
 
Graph Theory - Exercises - Chapters 2, 3, 4, 5, 6, 7, 8, and 9
Graph Theory - Exercises - Chapters 2, 3, 4, 5, 6, 7, 8, and 9Graph Theory - Exercises - Chapters 2, 3, 4, 5, 6, 7, 8, and 9
Graph Theory - Exercises - Chapters 2, 3, 4, 5, 6, 7, 8, and 9Michel Alves
 

En vedette (12)

Documentation - Reference Manual - SysSorting
Documentation - Reference Manual - SysSortingDocumentation - Reference Manual - SysSorting
Documentation - Reference Manual - SysSorting
 
Intelligent Transfer of Thematic Harmonic Color Palettes
Intelligent Transfer of Thematic Harmonic Color PalettesIntelligent Transfer of Thematic Harmonic Color Palettes
Intelligent Transfer of Thematic Harmonic Color Palettes
 
A Framework for Harmonic Color Measures
A Framework for Harmonic Color MeasuresA Framework for Harmonic Color Measures
A Framework for Harmonic Color Measures
 
Texture Synthesis: An Approach Based on GPU Use
Texture Synthesis: An Approach Based on GPU UseTexture Synthesis: An Approach Based on GPU Use
Texture Synthesis: An Approach Based on GPU Use
 
Effectiveness of Image Quality Assessment Indexes
Effectiveness of Image Quality Assessment IndexesEffectiveness of Image Quality Assessment Indexes
Effectiveness of Image Quality Assessment Indexes
 
Introduction to Kernel Functions
Introduction to Kernel FunctionsIntroduction to Kernel Functions
Introduction to Kernel Functions
 
Graph Theory - Exercises - Chapter 2 - Part II
Graph Theory - Exercises - Chapter 2 - Part IIGraph Theory - Exercises - Chapter 2 - Part II
Graph Theory - Exercises - Chapter 2 - Part II
 
Report - Lex and YACC
Report -  Lex and YACCReport -  Lex and YACC
Report - Lex and YACC
 
ID3 Algorithm - Reference Manual
ID3 Algorithm - Reference ManualID3 Algorithm - Reference Manual
ID3 Algorithm - Reference Manual
 
Graph Theory - Exercises - Chapter 3 - Algorithms of Dijkstra and Bellman-Ford
Graph Theory - Exercises - Chapter 3 - Algorithms of Dijkstra and Bellman-FordGraph Theory - Exercises - Chapter 3 - Algorithms of Dijkstra and Bellman-Ford
Graph Theory - Exercises - Chapter 3 - Algorithms of Dijkstra and Bellman-Ford
 
Graph Theory - Exercises - Chapter 3
Graph Theory - Exercises - Chapter 3Graph Theory - Exercises - Chapter 3
Graph Theory - Exercises - Chapter 3
 
Graph Theory - Exercises - Chapters 2, 3, 4, 5, 6, 7, 8, and 9
Graph Theory - Exercises - Chapters 2, 3, 4, 5, 6, 7, 8, and 9Graph Theory - Exercises - Chapters 2, 3, 4, 5, 6, 7, 8, and 9
Graph Theory - Exercises - Chapters 2, 3, 4, 5, 6, 7, 8, and 9
 

Similaire à Test Passing Parameters in C++.

Object Calisthenics em Go
Object Calisthenics em GoObject Calisthenics em Go
Object Calisthenics em GoElton Minetto
 
CONSTRUCTORS IN C++ +2 COMPUTER SCIENCE
CONSTRUCTORS IN C++ +2 COMPUTER SCIENCECONSTRUCTORS IN C++ +2 COMPUTER SCIENCE
CONSTRUCTORS IN C++ +2 COMPUTER SCIENCEVenugopalavarma Raja
 
Tugas praktikukm pemrograman c++
Tugas praktikukm  pemrograman c++Tugas praktikukm  pemrograman c++
Tugas praktikukm pemrograman c++Dendi Riadi
 
CONSTRUCTORS, DESTRUCTORS AND OPERATOR OVERLOADING.pptx
CONSTRUCTORS, DESTRUCTORS AND OPERATOR OVERLOADING.pptxCONSTRUCTORS, DESTRUCTORS AND OPERATOR OVERLOADING.pptx
CONSTRUCTORS, DESTRUCTORS AND OPERATOR OVERLOADING.pptxDeepasCSE
 
! Modernizr v2.0.6 httpwww.modernizr.com Copyri.docx
!  Modernizr v2.0.6  httpwww.modernizr.com   Copyri.docx!  Modernizr v2.0.6  httpwww.modernizr.com   Copyri.docx
! Modernizr v2.0.6 httpwww.modernizr.com Copyri.docxMARRY7
 
Constructor and Destructors in C++
Constructor and Destructors in C++Constructor and Destructors in C++
Constructor and Destructors in C++sandeep54552
 
Commenting in Agile Development
Commenting in Agile DevelopmentCommenting in Agile Development
Commenting in Agile DevelopmentJan Rybák Benetka
 
Working with Cocoa and Objective-C
Working with Cocoa and Objective-CWorking with Cocoa and Objective-C
Working with Cocoa and Objective-CKazunobu Tasaka
 
Making Java more dynamic: runtime code generation for the JVM
Making Java more dynamic: runtime code generation for the JVMMaking Java more dynamic: runtime code generation for the JVM
Making Java more dynamic: runtime code generation for the JVMRafael Winterhalter
 
Csharp4 inheritance
Csharp4 inheritanceCsharp4 inheritance
Csharp4 inheritanceAbed Bukhari
 
DAOFactory.javaDAOFactory.javapublicclassDAOFactory{ this .docx
DAOFactory.javaDAOFactory.javapublicclassDAOFactory{ this .docxDAOFactory.javaDAOFactory.javapublicclassDAOFactory{ this .docx
DAOFactory.javaDAOFactory.javapublicclassDAOFactory{ this .docxtheodorelove43763
 
case3h231diamond.gifcase3h231energy.jpgcase3h231moder.docx
case3h231diamond.gifcase3h231energy.jpgcase3h231moder.docxcase3h231diamond.gifcase3h231energy.jpgcase3h231moder.docx
case3h231diamond.gifcase3h231energy.jpgcase3h231moder.docxtidwellveronique
 
Nick: A Nearly Headless CMS
Nick: A Nearly Headless CMSNick: A Nearly Headless CMS
Nick: A Nearly Headless CMSRob Gietema
 

Similaire à Test Passing Parameters in C++. (20)

Devoxx 2012 (v2)
Devoxx 2012 (v2)Devoxx 2012 (v2)
Devoxx 2012 (v2)
 
Object Calisthenics em Go
Object Calisthenics em GoObject Calisthenics em Go
Object Calisthenics em Go
 
CONSTRUCTORS IN C++ +2 COMPUTER SCIENCE
CONSTRUCTORS IN C++ +2 COMPUTER SCIENCECONSTRUCTORS IN C++ +2 COMPUTER SCIENCE
CONSTRUCTORS IN C++ +2 COMPUTER SCIENCE
 
Tugas praktikukm pemrograman c++
Tugas praktikukm  pemrograman c++Tugas praktikukm  pemrograman c++
Tugas praktikukm pemrograman c++
 
Dart Workshop
Dart WorkshopDart Workshop
Dart Workshop
 
CONSTRUCTORS, DESTRUCTORS AND OPERATOR OVERLOADING.pptx
CONSTRUCTORS, DESTRUCTORS AND OPERATOR OVERLOADING.pptxCONSTRUCTORS, DESTRUCTORS AND OPERATOR OVERLOADING.pptx
CONSTRUCTORS, DESTRUCTORS AND OPERATOR OVERLOADING.pptx
 
UI testing in Xcode 7
UI testing in Xcode 7UI testing in Xcode 7
UI testing in Xcode 7
 
Vocabulary Types in C++17
Vocabulary Types in C++17Vocabulary Types in C++17
Vocabulary Types in C++17
 
! Modernizr v2.0.6 httpwww.modernizr.com Copyri.docx
!  Modernizr v2.0.6  httpwww.modernizr.com   Copyri.docx!  Modernizr v2.0.6  httpwww.modernizr.com   Copyri.docx
! Modernizr v2.0.6 httpwww.modernizr.com Copyri.docx
 
Constructor and Destructors in C++
Constructor and Destructors in C++Constructor and Destructors in C++
Constructor and Destructors in C++
 
Commenting in Agile Development
Commenting in Agile DevelopmentCommenting in Agile Development
Commenting in Agile Development
 
Working with Cocoa and Objective-C
Working with Cocoa and Objective-CWorking with Cocoa and Objective-C
Working with Cocoa and Objective-C
 
Making Java more dynamic: runtime code generation for the JVM
Making Java more dynamic: runtime code generation for the JVMMaking Java more dynamic: runtime code generation for the JVM
Making Java more dynamic: runtime code generation for the JVM
 
OOPS Basics With Example
OOPS Basics With ExampleOOPS Basics With Example
OOPS Basics With Example
 
Csharp4 inheritance
Csharp4 inheritanceCsharp4 inheritance
Csharp4 inheritance
 
DAOFactory.javaDAOFactory.javapublicclassDAOFactory{ this .docx
DAOFactory.javaDAOFactory.javapublicclassDAOFactory{ this .docxDAOFactory.javaDAOFactory.javapublicclassDAOFactory{ this .docx
DAOFactory.javaDAOFactory.javapublicclassDAOFactory{ this .docx
 
Day 1
Day 1Day 1
Day 1
 
case3h231diamond.gifcase3h231energy.jpgcase3h231moder.docx
case3h231diamond.gifcase3h231energy.jpgcase3h231moder.docxcase3h231diamond.gifcase3h231energy.jpgcase3h231moder.docx
case3h231diamond.gifcase3h231energy.jpgcase3h231moder.docx
 
C++ L05-Functions
C++ L05-FunctionsC++ L05-Functions
C++ L05-Functions
 
Nick: A Nearly Headless CMS
Nick: A Nearly Headless CMSNick: A Nearly Headless CMS
Nick: A Nearly Headless CMS
 

Plus de Michel Alves

About Perception and Hue Histograms in HSV Space
About Perception and Hue Histograms in HSV SpaceAbout Perception and Hue Histograms in HSV Space
About Perception and Hue Histograms in HSV SpaceMichel Alves
 
Color Harmonization - Results
Color Harmonization - ResultsColor Harmonization - Results
Color Harmonization - ResultsMichel Alves
 
Wave Simulation Using Perlin Noise
Wave Simulation Using Perlin NoiseWave Simulation Using Perlin Noise
Wave Simulation Using Perlin NoiseMichel Alves
 
Similarity Maps Using SSIM Index
Similarity Maps Using SSIM IndexSimilarity Maps Using SSIM Index
Similarity Maps Using SSIM IndexMichel Alves
 
Qualifying Exam - Image-Based Reconstruction With Color Harmonization
Qualifying Exam - Image-Based Reconstruction With Color HarmonizationQualifying Exam - Image-Based Reconstruction With Color Harmonization
Qualifying Exam - Image-Based Reconstruction With Color HarmonizationMichel Alves
 
TMS - Schedule of Presentations and Reports
TMS - Schedule of Presentations and ReportsTMS - Schedule of Presentations and Reports
TMS - Schedule of Presentations and ReportsMichel Alves
 
Month Presentations Schedule - March/2015 - LCG/UFRJ
Month Presentations Schedule - March/2015 - LCG/UFRJMonth Presentations Schedule - March/2015 - LCG/UFRJ
Month Presentations Schedule - March/2015 - LCG/UFRJMichel Alves
 
Color Palettes in R
Color Palettes in RColor Palettes in R
Color Palettes in RMichel Alves
 
Hue Wheel Prototype
Hue Wheel PrototypeHue Wheel Prototype
Hue Wheel PrototypeMichel Alves
 
Triangle Mesh Plot
Triangle Mesh PlotTriangle Mesh Plot
Triangle Mesh PlotMichel Alves
 
Capacity-Constrained Point Distributions :: Video Slides
Capacity-Constrained Point Distributions :: Video SlidesCapacity-Constrained Point Distributions :: Video Slides
Capacity-Constrained Point Distributions :: Video SlidesMichel Alves
 
Capacity-Constrained Point Distributions :: Density Function Catalog
Capacity-Constrained Point Distributions :: Density Function CatalogCapacity-Constrained Point Distributions :: Density Function Catalog
Capacity-Constrained Point Distributions :: Density Function CatalogMichel Alves
 
Capacity-Constrained Point Distributions :: Complementary Results
Capacity-Constrained Point Distributions :: Complementary ResultsCapacity-Constrained Point Distributions :: Complementary Results
Capacity-Constrained Point Distributions :: Complementary ResultsMichel Alves
 
Capacity-Constrained Point Distributions
Capacity-Constrained Point DistributionsCapacity-Constrained Point Distributions
Capacity-Constrained Point DistributionsMichel Alves
 
Five Minute Speech: An Overview of Activities Developed in Disciplines and Gu...
Five Minute Speech: An Overview of Activities Developed in Disciplines and Gu...Five Minute Speech: An Overview of Activities Developed in Disciplines and Gu...
Five Minute Speech: An Overview of Activities Developed in Disciplines and Gu...Michel Alves
 
Harris Detector Results
Harris Detector ResultsHarris Detector Results
Harris Detector ResultsMichel Alves
 
Class Diagram - MyImageLibrary
Class Diagram - MyImageLibraryClass Diagram - MyImageLibrary
Class Diagram - MyImageLibraryMichel Alves
 

Plus de Michel Alves (20)

About Perception and Hue Histograms in HSV Space
About Perception and Hue Histograms in HSV SpaceAbout Perception and Hue Histograms in HSV Space
About Perception and Hue Histograms in HSV Space
 
Color Harmonization - Results
Color Harmonization - ResultsColor Harmonization - Results
Color Harmonization - Results
 
Wave Simulation Using Perlin Noise
Wave Simulation Using Perlin NoiseWave Simulation Using Perlin Noise
Wave Simulation Using Perlin Noise
 
Similarity Maps Using SSIM Index
Similarity Maps Using SSIM IndexSimilarity Maps Using SSIM Index
Similarity Maps Using SSIM Index
 
Qualifying Exam - Image-Based Reconstruction With Color Harmonization
Qualifying Exam - Image-Based Reconstruction With Color HarmonizationQualifying Exam - Image-Based Reconstruction With Color Harmonization
Qualifying Exam - Image-Based Reconstruction With Color Harmonization
 
TMS - Schedule of Presentations and Reports
TMS - Schedule of Presentations and ReportsTMS - Schedule of Presentations and Reports
TMS - Schedule of Presentations and Reports
 
Month Presentations Schedule - March/2015 - LCG/UFRJ
Month Presentations Schedule - March/2015 - LCG/UFRJMonth Presentations Schedule - March/2015 - LCG/UFRJ
Month Presentations Schedule - March/2015 - LCG/UFRJ
 
Color Palettes in R
Color Palettes in RColor Palettes in R
Color Palettes in R
 
Sigmoid Curve Erf
Sigmoid Curve ErfSigmoid Curve Erf
Sigmoid Curve Erf
 
Hue Wheel Prototype
Hue Wheel PrototypeHue Wheel Prototype
Hue Wheel Prototype
 
Cosine Curve
Cosine CurveCosine Curve
Cosine Curve
 
Triangle Mesh Plot
Triangle Mesh PlotTriangle Mesh Plot
Triangle Mesh Plot
 
Triangle Plot
Triangle PlotTriangle Plot
Triangle Plot
 
Capacity-Constrained Point Distributions :: Video Slides
Capacity-Constrained Point Distributions :: Video SlidesCapacity-Constrained Point Distributions :: Video Slides
Capacity-Constrained Point Distributions :: Video Slides
 
Capacity-Constrained Point Distributions :: Density Function Catalog
Capacity-Constrained Point Distributions :: Density Function CatalogCapacity-Constrained Point Distributions :: Density Function Catalog
Capacity-Constrained Point Distributions :: Density Function Catalog
 
Capacity-Constrained Point Distributions :: Complementary Results
Capacity-Constrained Point Distributions :: Complementary ResultsCapacity-Constrained Point Distributions :: Complementary Results
Capacity-Constrained Point Distributions :: Complementary Results
 
Capacity-Constrained Point Distributions
Capacity-Constrained Point DistributionsCapacity-Constrained Point Distributions
Capacity-Constrained Point Distributions
 
Five Minute Speech: An Overview of Activities Developed in Disciplines and Gu...
Five Minute Speech: An Overview of Activities Developed in Disciplines and Gu...Five Minute Speech: An Overview of Activities Developed in Disciplines and Gu...
Five Minute Speech: An Overview of Activities Developed in Disciplines and Gu...
 
Harris Detector Results
Harris Detector ResultsHarris Detector Results
Harris Detector Results
 
Class Diagram - MyImageLibrary
Class Diagram - MyImageLibraryClass Diagram - MyImageLibrary
Class Diagram - MyImageLibrary
 

Dernier

Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024Janet Corral
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
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 17Celine George
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
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.pptxheathfieldcps1
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
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 SDThiyagu K
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 

Dernier (20)

Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
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
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
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
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
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
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 

Test Passing Parameters in C++.

  • 1. #include <iostream> /** * Test class. */ class Class { /** * Constructor. */ int _id; public: /** * Constructor. */ Class(int id = 0): _id(id) { std::cout << "Constructor Invocation! Id: " << _id << std::endl; }; /** * Id Method. */ void id(int myid){ _id = myid;} /** * Run method. */ void run(void) { std::cout << "Running! Id: " << _id << std::endl; }; /** * Destructor. */ virtual ~Class(void) { std::cout << "Destructor Invocation! Id: " << _id << std::endl;} }; // Function with passing parameter by value void TestFunction(Class c){ c.id(1); c.run(); }; // Function with explicit parameter passing by reference. void TestFunction(Class* c){ c->run(); }; // Function with parameter passing by automatic dereference. void TestFunction2(Class& c) { c.run(); }; int main(void) { Class c(0); std::cout << "n@@@" << std::endl; TestFunction(c); std::cout << "@@@" << "nn"; std::cout << "---" << std::endl; TestFunction(4); std::cout << "---" << "nn"; std::cout << "+++" << std::endl; TestFunction(&c); std::cout << "+++" << "nn"; std::cout << "$$$" << std::endl; TestFunction2(c); std::cout << "$$$" << "nn"; return 0; }