// CPPSample.cpp : Defines the entry point for the application.
//
#include <iostream>
using namespace std;
void SampleMethod(int& val)
{
val++;
}
int main()
{
int a = 5;
int b = 10;
int& ref = a;
ref = b;
SampleMethod(a);
cout << "Result: " << endl << a << endl << b << endl;
return 0;
}
To embed this program on your website, copy the following code and paste it into your website's HTML: