D Instructions for Q5 - Q7: A programmer writes a small C program, and organizes her...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
D Instructions for Q5 - Q7: A programmer writes a small C program, and organizes her code into three files, as shown below: ff qmain.c #include <stdio.h> #include cinttypes.h> uint32_t global = 42; int main() { uint32_t A global; helper (A); return 0; // 1 2 // 11 3 // 3 1/4 // 5 // 6 7/7 // 8 // 10 // Utils.c #include <stdio.h> #include <inttypes.h> void helper(uint32_t x) { II 1 11 2 11 6 11 S 1/ 10 // should return 42*42 - 18 uint32_tr friend(x); // 11 // 12 11 13 printf("r: "PRIU32\n", r): global = 10; uint32_t A global; helper (A); return 0; // Utils.h #ifndef UTILS H #define UTILS H #include <inttypes.h> Tendif 11 A 11 5 // 6 11 7 11 8 11 9 // 18 // 1 11 2 global-19; } 11 7 // 10 // should return 42*42 18 uint32_t r friend(x); // 11 // 12 // 13 printf("r: X*PRIU32"\n", r); static uint32_t friend(uint32_t z) { // 15 1716 return (22 global ); As shown, the code does not compile. The error messages shown in Q5 - Q7 are generated. For each question, write the code you would add in order to eliminate the error(s) described in that question. Indicate where the code would be added by referring to file names and line numbers shown in the given code. For example, you might (incorrectly) say to add: //q3main.c line 6 Do not make any alterations to the C statements that are given; you may only insert additional statements. Question 5 4 pts Question 5 centos> gcc -o q5-std-c11 -Wall -W q5main.c Utils.c Utils.c: In function "helper': Utils.c:8:4: error: 'global' undeclared (first use in this function) global 10; Edit View Insert Format Tools Table 12pt Paragraph BIUAT²V OND D Instructions for Q5 - Q7: A programmer writes a small C program, and organizes her code into three files, as shown below: ff qmain.c #include <stdio.h> #include cinttypes.h> uint32_t global = 42; int main() { uint32_t A global; helper (A); return 0; // 1 2 // 11 3 // 3 1/4 // 5 // 6 7/7 // 8 // 10 // Utils.c #include <stdio.h> #include <inttypes.h> void helper(uint32_t x) { II 1 11 2 11 6 11 S 1/ 10 // should return 42*42 - 18 uint32_tr friend(x); // 11 // 12 11 13 printf("r: "PRIU32\n", r): global = 10; uint32_t A global; helper (A); return 0; // Utils.h #ifndef UTILS H #define UTILS H #include <inttypes.h> Tendif 11 A 11 5 // 6 11 7 11 8 11 9 // 18 // 1 11 2 global-19; } 11 7 // 10 // should return 42*42 18 uint32_t r friend(x); // 11 // 12 // 13 printf("r: X*PRIU32"\n", r); static uint32_t friend(uint32_t z) { // 15 1716 return (22 global ); As shown, the code does not compile. The error messages shown in Q5 - Q7 are generated. For each question, write the code you would add in order to eliminate the error(s) described in that question. Indicate where the code would be added by referring to file names and line numbers shown in the given code. For example, you might (incorrectly) say to add: //q3main.c line 6 Do not make any alterations to the C statements that are given; you may only insert additional statements. Question 5 4 pts Question 5 centos> gcc -o q5-std-c11 -Wall -W q5main.c Utils.c Utils.c: In function "helper': Utils.c:8:4: error: 'global' undeclared (first use in this function) global 10; Edit View Insert Format Tools Table 12pt Paragraph BIUAT²V OND
Expert Answer:
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 ARASIN22227 17 18 19 20 21 23 24 25 26 1) (2) Sales Price per unit Variable Cost per unit Contribution per unit Contribution Margin Ratio Break Even Point Sales...
-
2 3 4 5 6 7 8 9 10 11 12 13 14 Start Excel Download and open the file named EXP19 Excel Ch06 ML2 HW DeckBuilders.xlsx. Grader has automatically added your last name to the beginning of the filename...
-
4 5 6 7 8 a 10 11 12 13 34S9 14 15 16 A B SSSS Present value Complete the following analysis. Do not hard code values in your calculations. All answers should be positive. 181 335 D 48,000 40,353...
-
Liberty Ventures Inc. reported a $320,000 profit in 2020 and declared preferred dividends of $20,000. The following changes in common shares outstanding occurred during the year: Jan 1 100,000 common...
-
Interest on its city hall bonds is paid from Allen Citys Debt Service Fund on February 1 and August 1. Should interest payable be accrued at December 31, the end of the citys fiscal year? Why? Would...
-
Locate the centroid (x, y) of the uniform wire bent in the shapeshown. -100 mm 20 mm 150 mm -X- -50 mm
-
Hemlock Semiconductor Operations, LLC, and SolarWorld Industries Sachsen GmbH, are both companies involved in the manufacture of components for solar power products. Prior to the lawsuit, the two...
-
Kerston Cameras, Inc., manufactures two models of cameras. Model ZM has a zoom lens; Model DS has a fixed lens. Kerston uses an activity-based costing system. The following are the relevant cost data...
-
An economic consultant for a fast-food chain has been given a random sample of the chains service workers. In her model, A, the length of time y between the time the worker is hired and the time a...
-
A backgammon player will be playing three consecutive matches with friends tonight. For each match, he will have the opportunity to place an even bet that he will win; the amount bet can be any...
-
The information that follows relates to equipment owned by Bonita Limited at December 31, 2023: Cost Accumulated depreciation to date Expected future net cash flows (undiscounted) Expected future net...
-
Can you identify examples of non-U.S. movies or products that have been modified for marketing in the United States?
-
select a cruise lineand share examples of how your selected cruise line markets themselves. You can share videos, commercials,marketing messages,advertisements, social media examples, etc. Please...
-
Example of using DSM-5-TR. First, choose one diagnosis( refer to this list below for a complete list of disorders). This way, everyone is expose variety of diagnoses. Neuro Coquitive Disorders...
-
6. How much does architect Rivera receive in interest , if on April 10 they give him $20,312.20 for a capital that deposited in an account with interest of 14.4% on the previous August 23?
-
https://www.progressive.com/ Global Marketing Any examples of global marketing or global partnerships that the company Progressive Insurance does?
-
Disney Hotels business district hotel and Disney Conventions are both profit centres. Both are owned by Disney Hotel Inc. Disney Conventions runs large trade-show conventions and rents conference...
-
Write an essay describing the differing approaches of nursing leaders and managers to issues in practice. To complete this assignment, do the following: 1. Select an issue from the following list:...
-
Calculate the amount of the child and dependent care credit allowed for 2012 in each of the following cases, assuming the taxpayers had no income other than the stated amounts. a. William and Carla...
-
Sophie is a single taxpayer. For the first payroll period in October 2012, she is paid wages of $3,250 monthly. Sophie claims three allowances on her Form W-4. a. Use the percentage method to...
-
During 2012, William purchases the following capital assets for use in his catering business: New passenger automobile (September 30)........................$21,500 Baking equipment (June 30)...
-
In the dark of night on July 28, 2012, in Oak Ridge, Tennessee, an 82 year-old nun and two Army veterans, ages 57 and 63, cut their way through four layers of fences and reached a building where the...
-
Should swearing be illegal? Why or why not?
-
Compare and contrast five types of terrorism.
Study smarter with the SolutionInn App