A
ArifulHossain tuhin
i have a stuct like following:
typedef struct{
char static[10];
int a;
int b;
}my_type;
now i've initialized it like following:
my_type * s;
s = (my_type *)malloc(sizeof(my_type));
memmove(a->static,buf,len);
s->a = 1;
s->b = 2;
myfunc((void *)&s);
void myfun(void ** data);
inside myfun i retain initialization for the static[10] field. but i loose other initializations of field a and field b.
thanks in advance.
typedef struct{
char static[10];
int a;
int b;
}my_type;
now i've initialized it like following:
my_type * s;
s = (my_type *)malloc(sizeof(my_type));
memmove(a->static,buf,len);
s->a = 1;
s->b = 2;
myfunc((void *)&s);
void myfun(void ** data);
inside myfun i retain initialization for the static[10] field. but i loose other initializations of field a and field b.
thanks in advance.