.NETGURU
Output from Console Application
Messages   Related Types
This message was discovered on microsoft.public.dotnet.languages.vc.

Post a new message to this list...

JezB
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.

Reply to this message...
 
    
Peter van der Goes
"JezB" <Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
[Original message clipped]

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.

Reply to this message...
 
    
ScottD
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" <Click here to reveal e-mail address> wrote in message news:Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
 




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification