Original Post
Writing a simple Debugging console for my current project and ran into a little problem. Usually I find myself writing the line cout << "Direction = " << d << "\n"; which I would rather replace with a line such as Debug.println("Direction",d); My problem is this: How do I pass in the variable d to my Debug class? I'm used to java with its everything extends the Object class structure. In java I would simply make the method println take an Object as a parameter then print this out. Attempting to follow this convention I tried using a void pointer but this only results in the data's reference being printed out. My next guess was that the method should take in an ostream object. This leads to a nasty style of" ostream os; os << d; Debug.println("Direction",os); which is hardly simplifying anything. I'm all confused, is there not a simple way to do this? Thanks in advanced Simon