/******************************************************************************
Welcome to code of Lập trình - Điện tử
Series: C++
Author: Nghĩa Taarabt
*******************************************************************************/
#include <iostream>
#include <iostream>
using namespace std;
void incre(int &ref) // ref là biến tham chiếu
{
cout << "ref = " << ref << endl;
ref = 2;
cout << "ref = " << ref << endl;
} // ref bị hủy sau khi thoát ra khỏi hàm
int main()
{
int x = 1;
cout << "x = " << x << endl;
incre(x);
cout << "x = " << x << endl;
return 0;
}