View Single Post
  #7   Spotlight this post!  
Unread 23-10-2005, 17:57
foobert foobert is offline
Registered User
no team
 
Join Date: May 2005
Location: oakland, ca
Posts: 87
foobert is a jewel in the roughfoobert is a jewel in the roughfoobert is a jewel in the rough
Re: Typedef Struct as function input

Quote:
Originally Posted by Mike
Is there a way to have typedef struct's as input to a function? EG:

Code:
void Function(typedef struct data)
{
printf("%s \n", data.something);
}

typedef struct{
int blah;
} typedef_example;

typedef_example data;
data.blah = 1;

Function(data);
Thanks =)

seems to me you want...

typedef struct{
int blah;
} typedef_example;


void Function (typedef_example data) {
printf("%s \n", data.blah);
}

void main () {
typedef_example data;
data.blah = 1;
Function (data);
}