Check out example codes for "create array of structs cpp". It will help you in understanding the concepts better.

Code Example 1

Customer::Customer(int id, string input_name): uid(id), name(input_name) {}
Customer customerRecords[2];
customerRecords[0] = Customer(25, "Bob Jones");
custoemrRecords[1] = Customer(26, "Jim Smith");

Learn ReactJs, React Native from akashmittal.com