我有以下函数被称为嵌入式AVR时钟上的程序模块的开始。我想从时钟对象中获取值,该值将返回一个date_time结构并将其复制到我从堆中分配的空间中。使用malloc和void指针复制临时结构
void time_set_mode_start(Display *display, volatile Controls *controls,
volatile TimeKeeper *clock, void *data) {
DEBUG_LED_PORT |= _BV(DEBUG_LED);
data = malloc(sizeof(date_time));
}
从clock-> getTime()返回数据到数据指针的返回值的最佳方式是什么?
没有[足够的信息](http://tinyurl.com/so-hints)。 [示例代码](http://sscce.org/)应该是完整和简明的。 TimeKeeper :: getTime的接口规范是什么? – outis