summaryrefslogtreecommitdiff
path: root/reference/CPLUSPLUS/EXAMPLES/refvar.cc
blob: 1e8ddd555863b3603a1fa1e4927a7f2513225611 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/************************************************************************
 *
 * Purpose: Demonstrate the use of reference variables.
 * Author:  M J Leslie
 * Date:    26-Oct-98
 *
 ************************************************************************/


#include <stdio.h>

int Square(int &Val);

main()
{
    int Number=10;

    Square(Number);

    printf("Number is %d\n", Number);
}

int Square(int &Val)
{
    Val *= Val;
}