Hi Xermi,

This is a basic C++ question that is best answered by a C++ book or C++
online resources.  As a hint osg::Node& is a C++ reference,  while
osg::Node* is a standard C pointer, to convert a reference to a pointer you
simply prepend a & i.e.
  osg::Node& node_ref = *another_node_ptr;
  osg::Node* node_ptr = &node_ref;

Robert.


On 15 April 2013 11:01, Xermi Martinez <[email protected]> wrote:

> Hi,
>
> 1st of all I have to apologize for my english, this is not my native
> language.
>
> Let's go to the point. I'm trying to match a osg::Node* into a osg::Node&,
> but I'm having some troubles.
>
> My code is like:
>
> Code:
> void function(osg::Node& node){
>         ...
>         osg::Node *n = (something that returns a pointer to an osg::Node)
>         ¿node = n?
>         ...
> }
>
>
> The thing is that I want to return that *Node into the &Node, and it must
> be like this because this is not my code, they gave me the function with
> the Node& argument and the function with the Node* return, so i have to
> take that Node* and match it into a Node&.
>
> I have tried to do the same thing I do with and int:
>
> Code:
> int a;
>         int *b;
>         a=*b;
>
>
> But I'm having that error:
>
> > Error 1       error C2248: 'osg::Object::operator =' : cannot access
> private member declared in class 'osg::Object'
>
> Can anyone help me, please?
>
> Thank you!
>
> Cheers,
> Xermi
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=53630#53630
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to