#include<iostream>
using namespace std;
class A
{
public:
A(int x)
{
a=x;
}
int a;
};
void fun(A temp)
{
cout<<temp.a<<endl;
}
int main()
{
fun(1);
}
Here we are passing primitive values to fun method and catching using object of class A. can anyone explain me how above code works and using which concept?