<pre><code>func()
{
    Object* pNext;
    func1(pNext);
}

func1(Object* pNext)
{
    pNext = Segement-&gt;GetFirstPara(0);
}
</code></pre>

<p>I was expecting it to be pointer to firstpara returned from func1() but I'm seeing NULL can some explain and how to fix it to actually return the firstpara() pointer?</p>

To change a pointer, you need to pass a pointer to the pointer, ie
```
Object** pNext
```
. To change the value of a variable inside a function, you pass a pointer. Hence, by extension, to change the value of a pointer inside a function, pass a pointer to the pointer.
```
```
func() { 
    Object* pNext;
    func1(&pNext);
}

func1(Object** pNext) { *pNext = Segement->GetFirstPara(0); }
```
```