|
-
August 26th, 2009, 12:44 PM
#5
Re: Beginner question about functions.
 Originally Posted by motobizio
I am not really an expert, but I think you could use a scruct.
You could define a scruct containing all the argouments of the "daughter" functions, and then pass one struct only as argoument.
Example:
Code:
functmother1(int a, int b)
{
functdaughter1(int c, int d);
functdaughter2(int e, int f);
}
you could define something like this:
Code:
typedef struct {
int a;
int b;
int c;
int d;
int e;
int f;
} MyStruct ;
functmother1(MyStruct Struct1)
{
functdaughter1(int Struct1.c, int Struct1.d);
functdaughter2(int Struct1.e, int Struct1.f);
}
Do you think it could be ok?
Not with that syntax. That doesn't really solve the problem. Everything still needs to be passed into the first function, you're just wrapping it into a struct instead of passing them as separate parameters.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|