--- a/function_pointers.c
+++ b/function_pointers.c
@@ -7,34 +7,34 @@
#include <stdlib.h>
typedef struct T {
- int a;
- int b;
+ int a;
+ int b;
} T;
-int plus(T t)
+int plus (T t)
{
- return t.a+t.b;
+ return t.a + t.b;
}
-int minus(T t)
+int minus (T t)
{
- return t.a-t.b;
+ return t.a - t.b;
}
-int func(T t, int (*ptrFunc)(T))
+int func (T t, int (*ptrFunc) (T))
{
- return ptrFunc(t);
+ return ptrFunc (t);
}
-int main(int argc, char **argv)
+int main (int argc, char **argv)
{
- T t = {
- .a = 20,
- .b = 10
- };
+ T t = {
+ .a = 20,
+ .b = 10
+ };
- printf("Result: %d\n", func(t, &plus));
- printf("Result: %d\n", func(t, &minus));
+ printf ("Result: %d\n", func (t, &plus));
+ printf ("Result: %d\n", func (t, &minus));
- return EXIT_SUCCESS;
+ return EXIT_SUCCESS;
}