Question: C++ // Program Differences is for investigating the differences // between automatic and static variables. #include using namespace std; void TestLocals(); int main () {

C++
// Program Differences is for investigating the differences
// between automatic and static variables.
#include
using namespace std;
void TestLocals();
int main ()
{
TestLocals ();
TestLocals ();
TestLocals ();
return 0;
}
// ***************************************
void TestLocals()
{
/* TO BE FILLED IN */
}
 C++ // Program Differences is for investigating the differences // between

Use program Differences for Exercises 1 and 2 / Program Differences is for investigating the differences /I between automatic and static variables #include using namespace std: void TestLocals) int main TestLocals) TestLocals) TestLocals) return 0: void TestLocals) /* TO BE FILLED IN Exercise 1: Function TestLocals defines a local variable, count, and initializes it to 1. The contents of count are incremented and sent to the output stream. Write this code and run program Differences. Record your output. Was it what you expected? Exercise 2: Change function TestLocals so that local variable count is a static variable. Rerun your program and show your output. Was it what you expected? Exercise 3: Explain the difference between automatie and statie variables

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!