Explicit initialization of struct/class members

前端 未结 4 1980
清歌不尽
清歌不尽 2021-02-13 15:22
struct some_struct{
    int a;
};
some_struct n = {};

n.a will be 0 after this;

I know this braces form of initialization is inherited from C a

4条回答
  •  心在旅途
    2021-02-13 16:02

    I find the following link to be very informative on this particular issue

    • http://publib.boulder.ibm.com/infocenter/lnxpcomp/v8v101/index.jsp?topic=/com.ibm.xlcpp8l.doc/language/ref/strin.htm

提交回复
热议问题