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.
"assignmentexpert.com" is professional group of people in Math subjects! They did assignments in very high level of mathematical modelling in the best quality. Thanks a lot
Comments
Leave a comment