Solved
typedef struct siblings {
char sibname[20];
char gender;
}sib;
typedef struct employee {
char empid[10];
char empname[20];
char status;
float sal;
sib ** s;
}emp;
typedef struct stackemp {
int size;
int ptrPos;
emp ** e;
}stack;
function myfunction(stac k * s) {
(s->e[s->size])...
User Profile
Collapse
-
I did not post my entire code
allocation for s->e ? complies & runs perfectly
s->e[s->size] = (emp *)malloc(sizeof (emp));
//where s->size has already been incremented
I am having problem only with
(s->e[s->size]->s[0]) = (sib *)malloc(sizeof (sib));
no compilation during run time i get sementation faultLeave a comment:
-
Memory allocation for Structure Pointer within Structure Pointer
typedef struct siblings {
char sibname[20];
char gender;
}sib;
typedef struct employee {
char empid[10];
char empname[20];
char status;
float sal;
sib ** s;
}emp;
typedef struct stackemp {
int size;
int ptrPos;
emp ** e;
}stack;
function myfunction(stac k * s) {
(s->e[s->size])...
No activity results to display
Show More
Leave a comment: