In java we can use System.out.println
In C# we can use Debug.Println
but how to do it in C++?
(The syntax, and where to look for the debug message)
jack1234
0
Newbie Poster
Recommended Answers
Jump to PostTry this:
#include<windows.h> #include<iostream> #define DebugMessage(str) OutputDebugString(str) int main() { DebugMessage("Hello"); std::cin.ignore(); return 0; }
Jump to PostYou are using a compiler with the world's best debugger. You don't need debug messages. Just compile your program for debug and use the debugger to set breakpoints, see the value of variables and program execution.
But to answer your question, how to print debug messages depends on whether …
Jump to PostI agree with AD on that, but there has been times when its been helpfull to use OutputDebugString to print directly to the output window, for example when I was working on a scheduler, every few minutes it would have display its status, which isn't possible to do using breakpoints. …
All 10 Replies
William Hemsworth
1,339
Posting Virtuoso
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
William Hemsworth
1,339
Posting Virtuoso
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
mitrmkar
1,056
Posting Virtuoso
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
mitrmkar
1,056
Posting Virtuoso
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
mitrmkar
1,056
Posting Virtuoso
bugmenot
25
Posting Whiz in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.