Question: Lab 4 Part II: Local and Global Variables Step 1 : Depending on your operating system, download ( lab 4 _ part 2 _ win.zip

Lab 4 Part II: Local and Global Variables
Step 1: Depending on your operating system, download (lab4
_part2_win.zip or
lab4
_part2
_macOS.zip) the starting code from Brightspace and extract the zipped file.
Step 2: Open the unzipped folder in VS Code
Step 3: lab4_part2_xxx folder contains the following files:
lab4test.h contains the declarations (function prototypes) for the functions defined in
lab4test.c Do not modify lab4test.h and lab4test.c.
main.c contains the main function. Do not modify main.c
Step 4: Open each of the files, get familiar with the variables and identify the scope of each of them.
Step 5: Answer the following questions and show your answers to the TAs:
- What is the scope of variable1 defined inside main.c?
- Are any of the variables variable1 defined inside lab4test.c the same as the variable defined inside
main.c?
- Does the assignment statement inside lab4test.c (line 7) modify the content of variable1 inside
main.c?
- How many distinct variables i there are in main.c? If more than one, what is the scope of each of
them?
- How many distinct variables variable1 there are in main.c? If more than one, what is the scope
of each of them?
- In lab4test.c, is the variable1 inside test2 the same as the variable inside test1?

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!