In my C++ code, I want to pass a structure as a function parameter. This is what I do:
struct funcpar
{
int loop,dex3[2][50];
char *Buf;
double wfc;
}param;
main{
void myfunc(struct funcpar param);
//statements;
//statements;
//statements;
myfucn(param);
////statements;
//statements;
}
void myfunc(struct funcpar param)
{
//statements;
//statements;
return 0;
}
Is the above syntax correct?
Initially I had those elements in the structure funcpar{} as the parameters within the function. Instead of passing 4+ parameter I thought of passing them as a structure. I however used the appropriate "." reference wherever applicable.
My code is throwing an exception which points at the myfunc(param) function call within main().
Please guide me.
Regards,
prads

New Topic/Question
Reply




MultiQuote





|