Quote Originally Posted by aamer4yu View Post
U should have posteed this in General programming... nothing specific to Qt...

neways this should help u...


Qt Code:
  1. struct refer{
  2. double Are;
  3. double Ere;
  4. };
  5.  
  6. class newstruct{
  7. public:
  8. newstruct();
  9. struct refer refer1;
  10. struct refer a(double b,double c);
  11. };
  12. In the .cpp file:
  13. refer newstruct::a(double b,double c)
  14. {
  15. refer1.Are=b;
  16.  
  17. refer1.Ere=c;
  18. cout<<refer1.Aref<<endl
  19. <<refer1.Eref<<endl;
  20.  
  21. return(refer1);
  22. }
  23.  
  24. newstruct objNewstruct;
  25. refer r2 = objNewstruct.a(3,4);
To copy to clipboard, switch view to plain text mode 


hope this helps...
I just change the defination of struct a,just as you said.Then its ok!
Thank you very much!