what's the difference between the following functions?
Void init1 ()
{
Static int yrs = 1;
Cout << “The value of yrs is ” << yrs << endl;
Yrs = yrs + 2;
return;
}
Void init2 ()
{
Static int yrs;
Yrs = 1;
Cout << “The value of yrs is ” << yrs << endl;
Yrs = yrs + 2;
return;
}
1
Expert's answer
2012-04-24T07:17:05-0400
The only difference between the following functions is that the first function init1 assigns static variable yrs simultaneously with its initialization and the second one assigns it after initialisation. There are no functional differences here.
Finding a professional expert in "partial differential equations" in the advanced level is difficult.
You can find this expert in "Assignmentexpert.com" with confidence.
Exceptional experts! I appreciate your help. God bless you!
Comments