How to Create a Typedef for a Function Pointer in C? Last Updated : 23 Jul, 2025 Comments Improve Suggest changes Like Article Like Report In C, a function pointer is a variable that stores the address of a function that can later be called through that function pointer. The typedef is a keyword used to create an alias or alternative name for the existing data types. In this article, we will learn how to create a typedef for a function pointer in C. Typedef for a Function Pointer in CTo create a typedef for a function pointer, we specify the return type of the function, followed by an asterisk (*) and the name of the typedef in parentheses. We also need to specify the number and types of parameters of the function pointer. Syntaxtypedef return_type (*alias_name)(parameter_types and numbers....);Here, return_type is the return type of the function alias-name is the alias we want to give to the function pointer type and parameter_types are the types of the parameters the function takes. C Program to Create a Typedef for a Function Pointer in C C // C Program for how to create a Typedef for a Function // Pointer #include <stdio.h> typedef int (*Operation)(int, int); int add(int a, int b) { return a + b; } // Function to the subtract two integers int subtracts(int a, int b) { return a - b; } // Driver Code int main() { // Declare function pointers using typedef Operation operationAdd = add; Operation operationSubtract = subtracts; printf("Addition result: %d\n", operationAdd(20, 9)); printf("Subtraction result: %d\n", operationSubtract(20, 9)); return 0; } OutputAddition result: 29 Subtraction result: 11 Create Quiz Comment V v29581x10 Follow 0 Improve V v29581x10 Follow 0 Improve Article Tags : C Programs C Language C-Pointers C-Functions C Examples +1 More Explore C BasicsC Language Introduction6 min readIdentifiers in C3 min readKeywords in C2 min readVariables in C4 min readData Types in C3 min readOperators in C8 min readDecision Making in C (if , if..else, Nested if, if-else-if )7 min readLoops in C6 min readFunctions in C5 min readArrays & StringsArrays in C4 min readStrings in C5 min readPointers and StructuresPointers in C7 min readFunction Pointer in C5 min readUnions in C3 min readEnumeration (or enum) in C5 min readStructure Member Alignment, Padding and Data Packing8 min readMemory ManagementMemory Layout of C Programs5 min readDynamic Memory Allocation in C7 min readWhat is Memory Leak? How can we avoid?2 min readFile & Error HandlingFile Handling in C11 min readRead/Write Structure From/to a File in C3 min readError Handling in C8 min readUsing goto for Exception Handling in C4 min readError Handling During File Operations in C5 min readAdvanced ConceptsVariadic Functions in C5 min readSignals in C language5 min readSocket Programming in C8 min read_Generics Keyword in C3 min readMultithreading in C9 min read Like