Answered step by step
Verified Expert Solution
Question
1 Approved Answer
THE LANGUAGE IS C, THE LAST 2 PICS ARE THE .c FILE, THE CODE SHOULD ALSO BE IN POINTER NOTATION This week we're covering pointers,
THE LANGUAGE IS C, THE LAST 2 PICS ARE THE .c FILE, THE CODE SHOULD ALSO BE IN POINTER NOTATION
This week we're covering pointers, and you should by now have completed all the readings on pointers, so you can start thinking about how best to approach this exercise. The goal of this exercise is to: - Help you practice using pointers to access information that is not declared inside some function - Help you practice using pointers to change information that lives outside a function - Help you better understand the relationship between strings, arrays, and pointers (you solved a string problem for Ex.2 using arrays, think about how you could have done it with pointers instead) Your task: Implement one function: wordSwapper() - Takes two pointers, one for an input string, and one for a different (we don't know what's in it, possibly junk) string. The function updates the second (destination) string so that it contains the same words as the input string, but in reverse order (the last word appears first, and vice versa). See the starter code below for details! fun with pointers2020.c a The starter code describes what you have to complete. Compiling the code For this exercise, we will start practicing compiling with more strict settings, we will add two flags to the compiler call. -Wall : Uses more strict checking for warnings, and reports anything it finds -Werror :Makes the compiler treat the warnings as if they were errors so you have to fix them in order to obtain an executable program. Please note - this flag may not be available or work properly on Mac, so it's up to you to treat warnings as errors and make sure you clear all of them. We will compile your exercise code, as well as ANY CODE YOU SUBMIT FROM NOW ON, using these flags, your code won't compile on our test machine if warnings have not been cleared. The compiler call will look like: gcc -Wall -Werror fun_with_pointers2020_studentNo.c Expected output - Once you completed the exercise, the output of your program should look like this: ...\a.exe The original string is: silence .is a looking bird:the turning; edge, of life. e. e. cummings Destination string after swapping: cummings e. e. life. of edge, turning; bird:the looking a .is silence Do not change any of the printf() statements in the program! They are already formatted to produce the output above if you completed the required functions properly. #includeStep by Step Solution
There are 3 Steps involved in it
Step: 1
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