Question: Task 4 : Use your own function In this task, we encapsulate the increment and print of the counter value in a function called print

Task 4: Use your own function
In this task, we encapsulate the increment and print of the counter value in a function called
print_and increment. Like in Task 3, the program must eventually exit the while loop and print the
"task completed" message.
In main.c, comment out task_3 and uncomment task_4. Open task_4 and observe the code
provided.
The prototype of the print_and_increment function is given. Complete the definition of the
function to implement the increment and print of the input argument (called value).
Call your function in the while-loop at the placeholder. Rebuild, run, and observe the "task completed"
print statement. The output must be similar as for Task 3(see Figure 3).
Replace your function prototype by the following
1 vold print_and_1ncrement [uint32_t *value) ;
Rewrite your function implementation and the call in the while-loop such that the program behavior
remains the same.
What is the difference between the two function techniques? How are they called?
 Task 4: Use your own function In this task, we encapsulate

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!