小编 Ad*_*dam的帖子

在 C 语言中使用“{}”进行转换有什么好处?

我试图理解为什么在 ProcessHacker 代码中使用这种铸造风格。

 RtlSetHeapInformation(
            PhHeapHandle,
            HeapCompatibilityInformation,
            &(ULONG){ HEAP_COMPATIBILITY_LFH }, // HEAP_COMPATIBILITY_LFH = 2UL 
            sizeof(ULONG)
            );
Run Code Online (Sandbox Code Playgroud)

使用“{}”进行转换有什么好处?它适用于 C 和 C++ 吗?

&(ULONG){ HEAP_COMPATIBILITY_LFH }, // HEAP_COMPATIBILITY_LFH = 2UL 
Run Code Online (Sandbox Code Playgroud)

c c++ literals compound-literals function-call

4
推荐指数
2
解决办法
166
查看次数

标签 统计

c ×1

c++ ×1

compound-literals ×1

function-call ×1

literals ×1