Problem with dynamic memory allocation
Hello, I am having a little problem allocating relatively large arrays using this chip, I am using SDK 5.0.4, I have a 2 structs,
typedef struct{ uint8_t x, uint8_t y;} s1;
typedef struct{
uint8_t c;
s1* buf; // pointer to array of first struct
}s2;
然后我对th动态分配内存e second structure s2,
s2* mys2 = malloc( sizeof(s2) );
then inside an initializer for struct s2, I am allocating memory for struct s1
s2->buf = malloc( sizeof(s1)*length );