#include <iostream>
#include <conio.h>

using namespace std;

//a is not a pointer
//we just changed the address of a
// to the parameter variable address
//f1(num)
void f1(int &a)  
{
    a = 8;
}

//pass by value
//f2(num)
void f2(int a)  
{
    a = 15;
}

//a is a pointer
//we set the address of a to be the same
// to the parameter variable address
//f3(&num1);
void f3(int *a)
{
 	*a = 20;
}


int main ()
{
    int num1 = 3;

    cout << "Before f1: " << num1 << endl;
    f1(num1);
    cout << "After f1: " << num1 << endl;
    f2(num1);
    cout << "After f2: " << num1 << endl;
    f3(&num1);
    cout << "After f3: " << num1 << endl;
    
    return 0;
}

