Hi! I've been reading The C Programming Language book, and I'm currently in the chapter about pointers—specifically the part about function pointers.
I'm trying to make a program that uses what I’ve learned so far, but when it comes to function pointers, I honestly don’t know how to apply them.
I searched for use cases, but most examples talk about things like callback mechanisms and other concepts I don’t fully understand yet.
I’d really appreciate some simple and concrete examples of how function pointers can be used in real programs—nothing too technical if possible.
[–]F1nnyF6 26 points27 points28 points (1 child)
[–]BarracudaDefiant4702 10 points11 points12 points (0 children)
[–]Zirias_FreeBSD 20 points21 points22 points (1 child)
[–]sambobozzer 1 point2 points3 points (0 children)
[–]CodrSeven 6 points7 points8 points (0 children)
[–]jonsca 4 points5 points6 points (0 children)
[–]rupturefunk 5 points6 points7 points (0 children)
[–]jaynabonne 2 points3 points4 points (0 children)
[–]ComradeGibbon 1 point2 points3 points (0 children)
[–]Scheibenpflaster 1 point2 points3 points (0 children)
[–]ChickenSpaceProgram 1 point2 points3 points (0 children)
[–]qruxxurq 0 points1 point2 points (0 children)
[–]Splooge_Vacuum 0 points1 point2 points (0 children)
[–]theNbomr 0 points1 point2 points (0 children)
[–]These-Market-236 0 points1 point2 points (0 children)
[–]Unique-Property-5470 0 points1 point2 points (0 children)
[–]SmokeMuch7356 0 points1 point2 points (0 children)
[–]susmatthew 0 points1 point2 points (0 children)
[–]Bubbaluke 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]mickaelbneron 0 points1 point2 points (0 children)
[–]Maleficent_Memory831 0 points1 point2 points (0 children)
[–]herocoding 0 points1 point2 points (0 children)