0

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

2
Contributors
5
Replies
6
Views
8 Years
Discussion Span
Last Post by d0pedup
0

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.

0

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

1

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.

Votes + Comments
Thanks for the reply....
0

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..?

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.