snippets / [Win32] OutputDebugString with printf formating

Language: C++ - First posted by themadmax on 2008-04-23 14:22 (5 months, 2 weeks)
Link to the snippet: http://www.friendsnippets.org/snippet/258/

Use OutputDebugString with printf formating

 1 void DebugDisplayFmt( const char *str, ... ) 
2 {
3 char buf[2048];
4
5 va_list ptr;
6 va_start(ptr,str);
7 vsprintf(buf,str,ptr);
8
9 ::OutputDebugString( buf );
10 }
11
12 //Use
13 int value = 123;
14 DebugDisplayFmt( "in %s(%d) : val = %d\n", __FILE__, __LINE__, value );
In order to post a comment, you should have a friendsnippet account. Please sign-in.

0 comments

Apr '08
  • Use OutputDebugString with printf formating

Common Tags



snippet History

Apr '08