memset() or value initialization to zero out a struct?

后端 未结 8 2170
你的背包
你的背包 2020-11-27 10:29

In Win32 API programming it\'s typical to use C structs with multiple fields. Usually only a couple of them have meaningful values and all others have to be zer

8条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-27 11:04

    not that it's common, but I guess the second way also has the benefit of initializing floats to zero. While doing a memset would certainly not

提交回复
热议问题