Re: [xml] what should to be 'const'?

massimo morara wrote:
        A little, little question.

In the function xmlCopyNode(const xmlNodePtr node, int extended) [tree.c], what is supposed be 'const'?

        The pointer 'node' or the struct pointed by 'node'?


                massimo morara

The general rule is this:

Write the declaration out, then read it backwards to determine what is const. In this case, I believe the declaration would be "const xmlNode *", so reading it backward says that it's a pointer to a xmlNode that is const. A const pointer would be "xmlNodePtr const node"

- Rush

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]