User Profile

Collapse

Profile Sidebar

Collapse
djcm75
djcm75
Last Activity: Dec 7 '11, 05:55 AM
Joined: Dec 2 '11
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • 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])...
    See more | Go to post

    Leave a comment:


  • 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 fault
    See more | Go to post

    Leave 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])...
    See more | Go to post
No activity results to display
Show More
Working...