Variables, References, Pointers


Overview

Variables

Variable (basic)

 

 

 

Reference variable

 

 

 

Pointer variable

 

 

 


Parameter Passing

actual parameter = parameter value (argument)

printCard(c1);

formal parameter = parameter variable (parameter)

void printCard(Card c) ...

Java - all parameters are pass-by-value

C++ - has three ways to do parameter passing:

 

 

Which way is specified in the function's header (prototype):

 

Pass-by-value

Pass-by-reference

Pass-by-const-reference