Typedef function pointer?

I’m learning how to dynamically load DLL’s but what I don’t understand is this line typedef void (*FunctionFunc)(); I have a few questions. If someone is able to answer them I would be grateful. Why is typedef used? The syntax looks odd; after void should there not be a function name or something? It looks … Read more

What is a typedef enum in Objective-C?

I don’t think I fundamentally understand what an enum is, and when to use it. For example: typedef enum { kCircle, kRectangle, kOblateSpheroid } ShapeType; What is really being declared here? 13 s 13 Three things are being declared here: an anonymous enumerated type is declared, ShapeType is being declared a typedef for that anonymous … Read more

What is the difference between ‘typedef’ and ‘using’ in C++11?

I know that in C++11 we can now use using to write type alias, like typedefs: typedef int MyInt; Is, from what I understand, equivalent to: using MyInt = int; And that new syntax emerged from the effort to have a way to express “template typedef”: template< class T > using MyType = AnotherType< T, … Read more