#include <iostream>

using namespace std;

class Number {
    double x;                       // encapsulation - hermetization
public:
    void    set(double);            // interface
    void    info(const char*);      // interface
};  

/*
void Number::set(double a) { 
    x = a;           
}
*/

void Number::set(double x) { // set the value of property Number::x
    this->x = x;             // name/identifier hiding (przesłanianie)
    printf("this: %p\n", this);
}


void Number::info(const char *s) {
   float x = 3.14;          // name/identifier hiding (przesłanianie)
    cout << s << " " << this->x << endl;
    cout << s << " " << x << endl;
}

int main() {
    Number L, M;

    L.set(10);
    L.info("set                   :");
    M.set(5);
    M.info("set                   :");

    printf("&L: %p\n", &L);
    printf("&M: %p\n", &M);
}

// https://www.geeksforgeeks.org/this-pointer-in-c/
