By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,376 Members | 1,566 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,376 IT Pros & Developers. It's quick & easy.

Output from Console Application

P: n/a
I'm compiling an old C program within Visual Studio to give me the
advantages of debugging within this environment. I'm building it as a
Console application using C++ as the language. It compiles and runs fine,
but if start debugging from within Visual Studio the standard output does
not seem to go anywhere. Standard output within my C program is via printf
commands. I dont want to start embedding Debug or Console statements since I
want the source to remain native C - I just want to compile and run it in
the visual studio environment.

How can I view the standard output within visual studio ? or how can I force
visual studio to run the program in a DOS window ?

The only way I can do what I want is to start the program in a dos window
then Attach to the process in visual studio, but this is not convenient as I
need to be able to step through the startup code.
Nov 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
When you start debugging, a new console window is supposed to open.
The new console window is where the printf output goes.

Try a small hello.c type app first to sanity check the whole thing.

"JezB" <je***********@blueyonder.co.uk> wrote in message news:u0**************@TK2MSFTNGP14.phx.gbl...
I'm compiling an old C program within Visual Studio to give me the
advantages of debugging within this environment. I'm building it as a
Console application using C++ as the language. It compiles and runs fine,
but if start debugging from within Visual Studio the standard output does
not seem to go anywhere. Standard output within my C program is via printf
commands. I dont want to start embedding Debug or Console statements since I
want the source to remain native C - I just want to compile and run it in
the visual studio environment.

How can I view the standard output within visual studio ? or how can I force
visual studio to run the program in a DOS window ?

The only way I can do what I want is to start the program in a dos window
then Attach to the process in visual studio, but this is not convenient as I
need to be able to step through the startup code.

Nov 17 '05 #2

P: n/a

"JezB" <je***********@blueyonder.co.uk> wrote in message
news:u0**************@TK2MSFTNGP14.phx.gbl...
I'm compiling an old C program within Visual Studio to give me the
advantages of debugging within this environment. I'm building it as a
Console application using C++ as the language. It compiles and runs fine,
but if start debugging from within Visual Studio the standard output does
not seem to go anywhere. Standard output within my C program is via printf
commands. I dont want to start embedding Debug or Console statements since I want the source to remain native C - I just want to compile and run it in
the visual studio environment.

How can I view the standard output within visual studio ? or how can I force visual studio to run the program in a DOS window ?

The only way I can do what I want is to start the program in a dos window
then Attach to the process in visual studio, but this is not convenient as I need to be able to step through the startup code.

Further on what Scott said. The command prompt window is there and will
display the output. However, it will remain in the background unless your
program pauses for user input, at which point it will come to the
foreground. Of course you can see both concurrently if you don't maximize VS
and do a little arranging. To see the output as you step through code,
Alt-Tab to the command prompt window periodically.
Also note that in Debug mode, Visual Studio does not automatically pause
your program just prior to termination so you can review output as it does
when you run using "Start Without Debugging". I'm sure you already know how
to pause your program by prompting for input, so do that as the last
statement to hold output on the screen.

--
Peter [MVP Visual Developer]
Jack of all trades, master of none.
Nov 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.