-1

I was going through one of the lecture slide taught in the class which included a typedef keyword in it. As opposed to normal use of typedef keyword where we usually put a alias for particular data, there was no alias put up for that example. Following is the example:See the typedef in the slide

Is the use of typedef correct, or am I interpreting differently?

1 Answers1

2

It is a function pointer. And it is perfectly valid syntax.

Ptr is declared as a pointer to a function where the function takes two int arguments and return an int. Here you can use Ptr as the alias to the typedefed type.

melpomene
  • 84,125
  • 8
  • 85
  • 148
user2736738
  • 30,591
  • 5
  • 42
  • 56