reference to pointer

void GetData( sFOO *&fooIn )
{
    char *pCH = "ABC";
    sFOO *lPoo = new sFOO();

    memcpy( lPoo->foo, pCH, strlen(pCH));

   
    fooIn = lPoo;
};


int _tmain(int argc, _TCHAR* argv[])
{
sFOO  *lpFOO = XE_NULL;

    GetData( lpFOO );
 }

void GetData( sFOO *&fooIn )
{
    char *pCH = "ABC";
    sFOO lPoo;// = new sFOO();

    memcpy( lPoo.foo, pCH, strlen(pCH));

   
    *fooIn = lPoo;
};

int _tmain(int argc, _TCHAR* argv[])
{
    sFOO    Foo;
    sFOO  *lpFOO = &Foo; //= XE_NULL;

    GetData( lpFOO );
 }

Comments

Popular posts from this blog

tex2D vs. tex2Dproj

Fast subsurface scattering

Physically-Based Rendering in WebGL