I'm from a C background and need help with the following lines of code

struct IGame
{
	// Summary
	//   Entry function used to initialize a new IGame of a GameMod
	// Parameters
	//   pGameFramework - a pointer to the game framework, from which a pointer of ISystem can be retrieved
	// Returns
	//   A pointer to the newly created IGame implementation
	typedef IGame *(*TEntryFunction)(IGameFramework* pGameFramework);
    .
    .
    .
    .

Thanks

Mods: Couldn't edit so i added another post.

Why would any one want to typedef a simple struct with that maze of brackets and stars.

Could you please tell me the meaning of

typedef IGameFramework *(*TEntryFunction)();

The above to me, looked like a function call with no void argument.

Member Avatar for jencas

TEntryFunction is a pointer to a function taking an IGameFramework pointer as a parameter and returning a pointer to an IGame

Member Avatar for jencas

Mods: Couldn't edit so i added another post.

Why would any one want to typedef a simple struct with that maze of brackets and stars.

Could you please tell me the meaning of

typedef IGameFramework *(*TEntryFunction)();

The above to me, looked like a function call with no void argument.

No, it is a type declaration of a function pointer:
TEntryFunction is a pointer to a function taking no argunemts and returning a IGameFramework pointer.

commented: Thanks for the reply.... +1

No, it is a type declaration of a function pointer:
TEntryFunction is a pointer to a function taking no argunemts and returning a IGameFramework pointer.

Thank you, Thank you, Thank you you are a life saver.

So the return value would be of the type IgameFrameWork* and the return value would be assessable via a IgameFrameWork* pointer right..?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.