Check out example codes for "<< operator overloading in c++". It will help you in understanding the concepts better.

Code Example 1

ostream &operator<<( ostream &output, const Distance &D ) {
  output << "F : " << D.feet << " I : " << D.inches;
  return output;

Learn ReactJs, React Native from akashmittal.com