U should have posteed this in General programming... nothing specific to Qt...
neways this should help u...
struct refer{
double Are;
double Ere;
};
class newstruct{
public:
newstruct();
struct refer refer1;
struct refer a(double b,double c);
};
In the .cpp file:
refer newstruct::a(double b,double c)
{
refer1.Are=b;
refer1.Ere=c;
cout<<refer1.Aref<<endl
<<refer1.Eref<<endl;
return(refer1);
}
newstruct objNewstruct;
refer r2 = objNewstruct.a(3,4);
struct refer{
double Are;
double Ere;
};
class newstruct{
public:
newstruct();
struct refer refer1;
struct refer a(double b,double c);
};
In the .cpp file:
refer newstruct::a(double b,double c)
{
refer1.Are=b;
refer1.Ere=c;
cout<<refer1.Aref<<endl
<<refer1.Eref<<endl;
return(refer1);
}
newstruct objNewstruct;
refer r2 = objNewstruct.a(3,4);
To copy to clipboard, switch view to plain text mode
hope this helps...
Bookmarks