Question: I'm running both my Jenkins & GitLab server on two difference EC2 instances.

Is there away that I can grant GitLab access an integration with my Jenkins over my Jenkins private ip address?

Answer: 
The **problem** is that you've forward declared class `C` in global namespace instead of class scope `A`. This means that there are two different class named `C` one of which is declared to be in the global namespace `::C` and the second one as an inner class `A::C`.

To **solve** this, just move the forward declaration of `class C` to inside class scope `A` as shown below:

**header.h**

```
class A {
public:
    class C;// forward declaration moved here inside class scope A
    class B {
    public:
        B(C* arg) {
            ptr = arg;
        }
        C* ptr;
    };
    class C {
    public:

    };
};

```

[Working demo](https://onlinegdb.com/FFS-LfKB-)

---

Also, be careful about other logical bugs like memory leak(if any) in your program.
```
class A {
public:
    class C;
    class B {
    public:
        B(C* arg) {
            ptr = arg;
        }
        C* ptr;
    };
    class C {
    public:
        ...
    };
};

```