Check out example codes for "c++ class member initialization". It will help you in understanding the concepts better.

Code Example 1

class Test  {
private:
  std::string data;
public:
  test(std::string data) : data(data) {}
  std::string getData() {
    return data;
  }
};

int main() {
  Test test("This is just some random Text");
  std::cout << test.getData() << std::endl;
  return 0;
}

Learn ReactJs, React Native from akashmittal.com