size of struct - size_t in c
For some reason I keep getting segmentation fault when I try to get the size of my struct.

    struct my_struct {
      char *a;
      int  b;
    };
    
    int main(int argc, char *argv[])
    {
    	struct my_struct dastruct;
    	size_t len = sizeof(dastruct) / sizeof(struct my_struct); // error
    	qsort(dastruct, len, sizeof(struct my_struct), cmp);
    	...
    }

Any ideas what I'm doing wrong? Thanks
size of struct - size_t in c
===

For some reason I keep getting segmentation fault when I try to get the size of my struct.

    struct my_struct {
      char *a;
      int  b;
    };
    
    int main(int argc, char *argv[])
    {
    	struct my_struct dastruct;
    	size_t len = sizeof(dastruct) / sizeof(struct my_struct); // error
    	qsort(dastruct, len, sizeof(struct my_struct), cmp);
    	...
    }

Any ideas what I'm doing wrong? Thanks