Pointers to structs...
Posted: Sun Apr 11, 2004 10:05 pm
Makslane, I'm not quite sure whether this is a bug or whether it isn't.
My problem is that when I try to have a function return a pointer to a user-defined structure,
The global code editor doesn't see the return type and therefore thinks that the function name is undeclared. For example:
typedef struct Lock
{
Actor* SourceActor;
Actor* TargetActor;
};
Lock* ReturnLockStruct()
{
. . .
. . .
}
Am I required to precede Lock with the struct keyword?
I've tried it and it works, but is it necessary to use this syntax?
I'm used to programming in C++, with which I think that the
syntax I used up on top is legal...
My problem is that when I try to have a function return a pointer to a user-defined structure,
The global code editor doesn't see the return type and therefore thinks that the function name is undeclared. For example:
typedef struct Lock
{
Actor* SourceActor;
Actor* TargetActor;
};
Lock* ReturnLockStruct()
{
. . .
. . .
}
Am I required to precede Lock with the struct keyword?
I've tried it and it works, but is it necessary to use this syntax?
I'm used to programming in C++, with which I think that the
syntax I used up on top is legal...