Help with function pointer syntax

Hi guys, I need some quick help. I want to know how I can write this better, I'm sure it's possible. I've only learnt it this way.

I have a library, with a class GS, and a static function GS* getGS(), which gives me a new instance of that class. Now the way I learned it is that you typedef the function:
(1) typedef GS* (*gg)();

And then you resolve the function from the library:
(2) gg getds = (gg) lib->resolve("getGS");

And then you call it when needed:
(3) GS *newInstance = getds();

I want to be able to skip the typedef part, I'm sure line (1) and (2) are combinable somehow. Thanks in advance.
It's possible, but why would you want this? It gets very ugly without typedefs.

1
2
GS* (*getds)() = (GS*(*)())lib->resolve("getGS");
GS* newInstance = getds();
Last edited on
Topic archived. No new replies allowed.