Can someone please help with this seemingly easy task. I have a struct and want to call another function that can manipulate the data within the struct.
I have a main where the struct is.
I have written a file to have the function.
And then I have written a mylib.h which is incl in each.
I can do this with an int to the function and manipulate it, but can't seem to get the syntax correct for a struct. Is there anything special about struct vs an int or char when doing this? What am I missing. I have ??? where I keep having the problem. I have written exactly as seen in two books, but still no.
**********************************
/* mylib.h ---my test header file */
void fnA (???)
*********************************
/* misfunc.c -- contains function declarations */
#include "mylib.h"
void fnA( ??? )
{
//do some stuff here;
}
********************************
/* test.c -- contains the main program */
#include "mylib.h"
typedef struct mystruct
{
//my structure schtuff
}Config;
main ()
{
Config myconfig = {/*initializers*/};
fnA ( &myconfig );
}
Thanks,
J
I have a main where the struct is.
I have written a file to have the function.
And then I have written a mylib.h which is incl in each.
I can do this with an int to the function and manipulate it, but can't seem to get the syntax correct for a struct. Is there anything special about struct vs an int or char when doing this? What am I missing. I have ??? where I keep having the problem. I have written exactly as seen in two books, but still no.
**********************************
/* mylib.h ---my test header file */
void fnA (???)
*********************************
/* misfunc.c -- contains function declarations */
#include "mylib.h"
void fnA( ??? )
{
//do some stuff here;
}
********************************
/* test.c -- contains the main program */
#include "mylib.h"
typedef struct mystruct
{
//my structure schtuff
}Config;
main ()
{
Config myconfig = {/*initializers*/};
fnA ( &myconfig );
}
Thanks,
J