Difference Between these two types of functions

For developers writing C++, Fortran, Java, code who have questions or comments to make.

Moderators: silvia, selimgunay, Moderators

Post Reply
polimeruvijay
Posts: 43
Joined: Fri Jan 29, 2016 10:20 pm

Difference Between these two types of functions

Post by polimeruvijay »

Could anybody please explain what is the difference between these two functions, which I found in "FAFourSteelRCPlaneStress.h and .cpp", It seems both types are doing the same action, i.e. returning the same vector.

Type - 1 :

const Vector &getStress(void);
const Vector &getStrain(void);

Type - 2 :

const Vector &getCommittedStress(void);
const Vector &getCommittedStrain(void);

###-----------------------Function Definition in .cpp file -----------------------------------------------

const Vector& FAFourSteelRCPlaneStress::getStress(void)
{

return stress_vec;
}


const Vector& FAFourSteelRCPlaneStress:: getStrain()
{
return strain_vec;
}

const Vector& FAFourSteelRCPlaneStress::getCommittedStress(void)
{
return stress_vec;
}

const Vector& FAFourSteelRCPlaneStress::getCommittedStrain(void)
{
return strain_vec;
}

Thanks in advance ...
Post Reply