3
answers
0
watching
118
views

This is also in c program code.

 

To demonstrate pointers to functions, the sample output below shows the bubble-sort program. It consists of main and functions bubbleSort, swap, ascending, and descending. Function bubbleSort receives a pointer to a function as an argument—either function ascending or function descending—in addition to an int array and the array’s size. The user chooses whether to sort the array in ascending (1) or descending (2) order. If the user enters 1, the main passes a pointer to the function ascending to function bubbleSort. If the user enters 2, the main passes a pointer to the function descending to function bubbleSort.

For unlimited access to Homework Help, a Homework+ subscription is required.

Avatar image
Liked by brm and 2 others

Unlock all answers

Get 1 free homework help answer.
Already have an account? Log in
Avatar image
Read by 2 people
Already have an account? Log in
Avatar image
Read by 1 person
Already have an account? Log in
Start filling in the gaps now
Log in