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

Drawing textured cube with Vulkan on Android

glTF loader for Android Vulkan

C++ unit testing & CI integration in GitHub (I/2)