Introduction
Pointer to a function is a way to store the memory address of a function just like a variable stores the memory address of a value. When a function is called through a pointer, it is called pointer to a function.
In this lab, we will write a C program to demonstrate how to use a pointer to a function.
Skills Graph
%%%%{init: {'theme':'neutral'}}%%%%
flowchart RL
c(("`C`")) -.-> c/UserInteractionGroup(["`User Interaction`"])
c(("`C`")) -.-> c/BasicsGroup(["`Basics`"])
c(("`C`")) -.-> c/PointersandMemoryGroup(["`Pointers and Memory`"])
c(("`C`")) -.-> c/FunctionsGroup(["`Functions`"])
c/UserInteractionGroup -.-> c/output("`Output`")
c/BasicsGroup -.-> c/comments("`Comments`")
c/BasicsGroup -.-> c/variables("`Variables`")
c/BasicsGroup -.-> c/data_types("`Data Types`")
c/BasicsGroup -.-> c/operators("`Operators`")
c/PointersandMemoryGroup -.-> c/pointers("`Pointers`")
c/FunctionsGroup -.-> c/function_parameters("`Function Parameters`")
c/FunctionsGroup -.-> c/function_declaration("`Function Declaration`")
subgraph Lab Skills
c/output -.-> lab-123303{{"`Pointer to a Function`"}}
c/comments -.-> lab-123303{{"`Pointer to a Function`"}}
c/variables -.-> lab-123303{{"`Pointer to a Function`"}}
c/data_types -.-> lab-123303{{"`Pointer to a Function`"}}
c/operators -.-> lab-123303{{"`Pointer to a Function`"}}
c/pointers -.-> lab-123303{{"`Pointer to a Function`"}}
c/function_parameters -.-> lab-123303{{"`Pointer to a Function`"}}
c/function_declaration -.-> lab-123303{{"`Pointer to a Function`"}}
end