Re: Need VB str() to show debug msg.
Boki wrote:
Ulrich Eckhardt ???
- [C/C++] sprintf/swprintf/_stprintf
Just look at the docs/MSDN.
- [C++] std::stringstream
These can be used to format anything that has overloaded operator<< for
them.
Can these run in WIN32 app ?
I got error C2065: 'sprintf' : undeclared identifier
Okay, first thing to do is that you read the documentation in the MSDN
(http://msdn.microsoft.com, there is also a Firefox plugin that makes
searching there even quicker). There, when you scroll down, you will see
two prerequisites to use this function: the required headers (#include<>
those) and the required libs (add these to the linker input in the project
settings if you get unresolved symbols while linking). The same applies to
the use of std::stringstreams, in case you write C++ code (which you
neither confirm nor deny).
Just a little confusing... I believe everyone need to debug integers..
but in Win32 app, it is very inconvinent to debug it ( because I can
only use TextOut to output a string )
You can also watch variables in the debugger, though that's not always
applicable.
Could you please advice which method are you using ?
Depends:
- Logfiles, using fprintf in C or std::ofstream in C++.
- Writing to stdout/stderr (using printf in C or iostreams in C++).
- Writing to the debug-trace of the IDE (using OutputDebugString() in C and
an iostream wrapper around it in C++).
- TRACE() macro in MFC projects (it's in fact a wrapper around
OutputDebugString, too, but with a printf-style syntax).
Uli