malloc

#include <iostream>
#include "stdint.h"

typedef struct {
uint16_t param_count;
uint16_t result_count;
uint16_t param_cell_num;
uint16_t ret_cell_num;
/* types of params and results */
uint8_t types[1];
} WASMType;

typedef struct {
uint16_t param_count;
uint16_t result_count;
uint16_t param_cell_num;
uint16_t ret_cell_num;
/* types of params and results */
uint8_t types[];
} WASMType2;

typedef struct {
uint16_t param_count;
uint16_t result_count;
uint16_t param_cell_num;
uint16_t ret_cell_num;
/* types of params and results */
uint8_t types[0];
} WASMType3;

int main() {
std::cout << sizeof(WASMType) << std::endl;
std::cout << sizeof(WASMType2) << std::endl;
std::cout << sizeof(WASMType3) << std::endl;
return 0;
}
上一篇:jump to label [XXX]的报错


下一篇:C语言----最小路径和