Warning C4099: type name first seen using 'class' now seen using 'struct' (MS VS 2k8)

前端 未结 7 2185
萌比男神i
萌比男神i 2021-01-04 01:42

Is this warning anything to worry about? I\'ve read that it can cause erratic behaviour?

It\'s an example I\'m trying to compile, could someone explain to me why the

7条回答
  •  被撕碎了的回忆
    2021-01-04 02:08

    Although this is considered bad practice, I think there should be no problem mixing class definition and struct declaration, as they are basically the same data type. The main difference is that struct members are by default public, contrary to class members which are private, but otherwise the memory layout is identical.

提交回复
热议问题