Class Point is working correctly, It is creating x, y point. Code:
point.h file
#ifndef POINT_H
#define POINT_H
namespace pt
{
    class Point
    {
        int x, y;
    public:
        Point();
        Point(int x, int y);
        int getX();
        int getY();
    };
}
#endif // POINT_H
point.cpp file
#include "point.h"
pt::Point::Point()
{
    this->x = this->y = 0;
}
pt::Point::Point(int x, int y)
{
    this->x=x;
    this->y=y;
}
int pt::Point::getX()
{
    return this->x;
}
int pt::Point::getY()
{
    return this->y;
}
Meanwhile when I try to create new Point3D class in main that will inherit from Point x, y coordinates and add z to create third dimension, new constructor cant get access to x, y of Point class. Errors are: 1. 'int pt::Point::x' is private at first and second this-> in Point3D constr. 2. Both are 'out of context'
main.cpp
#include <iostream>
#include "point.h"
int main()
{
    class Point3D : public pt::Point
    {
        int z;
    public:
        getZ()
        {
            return this->z;
        }
        Point3D(int x ,int y, int z)
        {
            this->x=x;
            this->y=y;
            this->z=z;
        }
    };
    return 0;
}
Thanks for help.
 
    