Check out example codes for "c++ struct constructor". It will help you in understanding the concepts better.

Code Example 1

struct TestStruct {
        int id;
        TestStruct() : id(42)
        {
        }
};

Learn ReactJs, React Native from akashmittal.com