发布时间:2018-12-12 16:19:31
#include <stdio.h>struct Test {int len;char data[0];};int main(){char str[] = "abc";Test* t = (Test*)malloc(sizeof(struct Test) + sizeof(str));t->len = sizeof(str);memcpy(t->data, str, sizeof(str));printf("len: %d\n", t->len);printf("data: %s\n", t->data);free(t);}.........【阅读全文】