V
vp
If I have a pointer char * p, is it correct to assign NULL to this
pointer by:
"memset( &p, 0, sizeof(p));" instead of "p = NULL;"
The reason I ask is I have an array of structure of N function
variables, for example,
typedef struct
{
int (* func1)();
int (* func2)();
void * (* func2)(int );
} ModuleFunctions;
#define N 100
ModuleFunction garMF[N];
When initializing, instead of making a loop to assgin NULL to each
function member of struct ModuleFunction for each member of array, is
it correct to do something like
memset( garMF, 0, sizeof(ModuleFunctions)*N );
Thanks for your help,
DT
pointer by:
"memset( &p, 0, sizeof(p));" instead of "p = NULL;"
The reason I ask is I have an array of structure of N function
variables, for example,
typedef struct
{
int (* func1)();
int (* func2)();
void * (* func2)(int );
} ModuleFunctions;
#define N 100
ModuleFunction garMF[N];
When initializing, instead of making a loop to assgin NULL to each
function member of struct ModuleFunction for each member of array, is
it correct to do something like
memset( garMF, 0, sizeof(ModuleFunctions)*N );
Thanks for your help,
DT