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

Code Example 1

struct Par 
{
    int a, b;
    // constructor base
    Par() { a = b = 0; }
    // destructor base
    ~Par() { cout << "hecho..." << endl; }
    void setA(int n) { a = n; }
    void setB(int n) { b = n; }
    void mostrar() 
    {
        cout << "a = " << a << ", b = " << b << "; suma = " << a+b << endl;
    }
};

Learn ReactJs, React Native from akashmittal.com