Hi I'm currently learning C++ and I'm trying to pass the value by reference, but I'm having issues with getting the correct output. What seems to be the problem??
void ref(int a)
{
cout << "a = " << a << endl;
a = 1;
cout << "a = " << a << endl;
}
int main()
{
int b = 10;
cout << "b = " << b << endl;
ref(b);
cout << "b = " << b << endl;
return 0;
}