CSC209H1 Chapter 6: CSC209H1 Chapter : DISCOVER Function Pointers - Part 1 of 1

40 views5 pages
11 Feb 2019
School
Course
Professor

Document Summary

Function pointers video 1: introducing function pointers compare_so rts1 compare_so rts2 sorts. The third option means that x is a function ptr of a function that takes in 1 input argument char* and returns char*. X is assigned to point to the function named my_function. Function pointers video 2: extending the worked example. We do not need to deference the function to make the function call. Remember to put parenthesis outside the function name, otherwise not working well. We pass in the name of the function into time_sort(), not call the function i. e. function(a,b), not &function. Notice how the array of sort_info is written. See the way how the for loop is written. However, this might result in a segmentation fault if we do not do any error checking inside the main function. What we do in order to return the above.

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents

Related Questions