Not sure exactly what you are trying to acheive with your function, how ever you might do this
#include <iomanip>
#include <iostream>
using namespace std;
class myclass
{
public :
int m,n;
myclass(){m=10;n=12;}
}
void disp( myclass& obj )
{
cout<<"Hello"<<endl
<<obj.m;
return;
}
void main()
{
myclass myobjct();
disp( myobjct );
return;
}
|