0

this is a quick question. I am building a program in C++ and have this weird problem when it comes to print some data in the output window. I don't get any data in the output window but when I set a breakpoint I can see that data is in the variable that I am trying to print. So I am going a bit loco here.

This is the line I use to print my data:

std::cout << midiNoteNumber << std::endl;

Why does nothing appear in the debugging output window?

  • 1
    This one line on its own is not enough information for us to help. Please include a [MCVE], and include details on how you compile and run it. (My initial suspicion is regarding the **type** of `midiNoteNumber` - what is it?) – BoBTFish May 17 '18 at 08:27
  • 1
    show the whole function ? can't get the context. – xanadev May 17 '18 at 08:28
  • 1
    The debug console in visual studio doesn't pipe from stdout. Never has. Use OutputDebugString if you want debug console output. – WhozCraig May 17 '18 at 08:30
  • 4
    Possible duplicate of [How do I print to the debug output window in a Win32 app?](https://stackoverflow.com/questions/1333527/how-do-i-print-to-the-debug-output-window-in-a-win32-app) – Robert Andrzejuk May 17 '18 at 08:30
  • 4
    Possible duplicate of [How to redirect stdout to output window from visual studio](https://stackoverflow.com/questions/5248704/how-to-redirect-stdout-to-output-window-from-visual-studio) – acraig5075 May 17 '18 at 08:36
  • Possible duplicate of https://stackoverflow.com/questions/3179199/simplest-way-to-write-output-message-to-output-window-in-visual-studio-2010 – Robert Andrzejuk May 17 '18 at 08:41

1 Answers1

-2

OutputDebugString is nothing that I could get working so I solved it by doing this:

_RPT1(0, "%d\n", midiNoteNumber);