Answered step by step
Verified Expert Solution
Question
1 Approved Answer
3. Write a C++ program, where you calculate the subprogram performance of a global static array and local array with same size, same content.
3. Write a C++ program, where you calculate the "subprogram performance" of a global static array and local array with same size, same content. To accomplish this, declare a static global integer array with size 500000. Then, inside of your main declare another integer array with the same size. After that, fill both arrays with the numbers starting from 0 to 500000. Later, declare a function that takes an array as a parameter and returns nothing. In the function update the values in the array with multiplying them by 100. Also, print each element on the screen. Lastly, your job is to run the function you have declared twice. First with the local array as parameter and then once more with second array as parameter. You need to measure the time elapsed at each function run. Print the difference between measured times and see which array makes the function run faster.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Sure here is the C program C include include using names...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started