A- What does the following function do? Explain. int guess (char string[]) { int len strlen(string);...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
A- What does the following function do? Explain. int guess (char string[]) { int len strlen(string); int i; char tmp; for (i = 0; i < len / 2; i = 1 + 1) ( tmp = string[i]; string[i] = string [len 1 - 11; string [len 1 - 1] = tmp; = } return 0; B- Rewrite the function using pointers. A- What does the following function do? Explain. int guess (char string[]) { int len strlen(string); int i; char tmp; for (i = 0; i < len / 2; i = 1 + 1) ( tmp = string[i]; string[i] = string [len 1 - 11; string [len 1 - 1] = tmp; = } return 0; B- Rewrite the function using pointers.
Expert Answer:
Answer rating: 100% (QA)
Answer A The function reverses the string Inside the loop we can observe that we are sw... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
What does the following function do? def testl (picture): for p in getPixels (picture): setRed (p, getRed (p) * 0.3)
-
What does the following function do? def test2 (picture): for p in getPixels(picture): setBlue (p, getBlue(p) * 1.5)
-
What does the following statement mean? Indeed, every decision we make involves some kind of trade-off. Under what condition would the statement not be true?
-
The Eldorado Corporation's controller prepares adjusting entries only at the end of the fiscal year. The following adjusting entries were prepared on December 31, 2011: Additional information: 1. The...
-
Silver Aviation assembles small aircraft for commercial use. The majority of Silvers business is with small freight airlines serving areas where the airport does not accommodate larger planes. The...
-
In problem, the graph of a logarithmic function is given. Match each graph to one of the following functions: (a) y = log 3 x (b) y = log 3 (-x) (c) y = -log 3 x (d) y = -log 3 (-x) (e) y = log 3 x 1...
-
The accountant for Flenderson Roofing, Inc., posted adjusting entries (a) through (e) to the accounts at December 31, 2010. Selected balance sheet accounts and all the revenues and expenses of the...
-
Effect of temporary differences on income taxes. Woodward Corporation purchases a new machine for $50,000 on January 1, 2008. The machine has a four-year estimated service life and an estimated...
-
The adjusted trial balance of Personal Financial Planners appears below. Using the information from the adjusted trial balance, you are to prepare for the month ending December 3 1 , 2 0 2 0 : 1 . an...
-
Calculate the effective bandwidth for the following cases. For (a) and (b), assume there is a steady supply of data to send; for (c), simply calculate the average over 12 hours. (a) 10-Mbps Ethernet...
-
A factory contains 3 production departments P1, P2 and P3, and a maintenance department that provides a service to these 3 production centres. Relevant data is as follows: Directly allocated costs...
-
How do bridge design principles balance structural integrity with aesthetic considerations, and what are some iconic examples that showcase this balance ?
-
A fishing boat accidentally releases 3.0 barrels of diesel into the ocean. Each barrel holds 42 gallons. If the layer of diesel in the ocean is 2.5 x 102 nm thick, how many square meters does this...
-
Explain four future plausible scenarios for a Canada commercial banking industry .Analyze the macro environment for Canada commercial banking industry 3.key uncertainties for future and certainty two...
-
The type of activity investigators are involved in, and the evidence gathered varies depending on whether investigations use the reactive or proactive method and, whether it is a serious and/or major...
-
What are the emerging technologies in environmental remediation that address soil and groundwater contamination, and how do they impact the sustainability of civil engineering projects ?
-
( a ) Explain the heat treatment methods of: ( i ) annealing, ( ii ) normalizing, ( iii ) quenching, ( iv ) tempering, and ( v ) austempering. ( b ) Explain how tempering can be used to improve the...
-
B.) What is the approximate concentration of free Zn 2+ ion at equilibrium when 1.0010 -2 mol zinc nitrate is added to 1.00 L of a solution that is 1.080 M in OH - . For [Zn(OH) 4 ] 2- , K f = 4.610...
-
Fill in the blanks in each of the following statements: a) The __________executes .NET programs. b) The CLR provides various services to __________code, such as integrating software components...
-
State whether each of the following is true or false. If false, explain why. a) The smallest data item in a computer can assume the value 1 or the value 2. Such a data item is called a bit (short for...
-
Expand each of the following acronyms: a) W3C b) OOP c) CLR d) MSIL e) UML f) IDE
-
What is a best practice in general? Give examples of best practices in an area unrelated to project management, such as nutrition, exercise, or child rearing.
-
What are some unique features of project management software in general?
-
Why should organizations identify and use best practices? What are the main categories of best practices developed as part of OPM3?
Study smarter with the SolutionInn App