&(void *){ NULL } 是什么意思
逃逃VS海 2015-11-06 11:07:16 在研究 ffmpeg中遇到一个函数
void av_freep(void *arg)
{
void *val;
memcpy(&val, arg, sizeof(val));
memcpy(arg, &(void *){ NULL }, sizeof(val)); // 这个语句在gcc编译中能编译,而我在VS中却无法编译提示错误
av_free(val);
}
// 然后我用 memcpy(arg, NULL, sizeof(val)); 来代替, 结果gcc编译出来的ffmpeg库 却运行出错, 显然说明 不能这么替代,
请问高手, 如何在VS中替代memcpy(arg, &(void *){ NULL }, sizeof(val));这句语句的实现