Hi Guys
What's the best way to output the address of an object e.g. JB_Node* aNodePtr;
How do I output the value of aNodePtr?
Thanks
Jeff
Hi Guys
What's the best way to output the address of an object e.g. JB_Node* aNodePtr;
How do I output the value of aNodePtr?
Thanks
Jeff
A pointer must have a values,And to me it seems like JB_Node is a class so it must have member functions and attrubutes.it depends which value you are looking for.
This is, of course, only for developer consumption.
works fine here. You can even provide your own operator<<() to format it however you want:Qt Code:
qDebug() << aNodePtr; 0x2197f50 // for a non-QObject JB_Node(0x2197f50) // if JB_Node is a QObjectTo copy to clipboard, switch view to plain text mode
Qt Code:
QDebug operator<<(QDebug dbg, JB_Node *node) { return dbg.space(); }To copy to clipboard, switch view to plain text mode
Jeffb (17th April 2012)
Bookmarks