473,385 Members | 1,907 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Output from Console Application

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
2 2489
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

"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Boba | last post by:
Hi, I'm programming a WinForm application. I would like to enter commands that will send output that will help me to locate bugs in the future. I know that there is a way to send output by...
1
by: noleander | last post by:
Hi. I've got a C++ program written in Visual C++ 2003. The program is trivial, created with the Program-creation wizard: used the .NET "Form" template. The program has a trivial...
1
by: Rvo | last post by:
I'm writing an application that should work both as a GUI and a commandline program. When running from commandline I want to give all output to the commandline instead of showing it it an own...
0
by: F.C. | last post by:
Hello, :) I'm currently writing a frontend for a console application using VB .net. I'm using the traditional Process creation to launch it and redirect input and output to my windows...
4
by: garyusenet | last post by:
Hi. I am trying to learn about array lists, and found an example on MSDN. I tried to compile it but it's not producing any output. I can't see why. Any ideas? Here is what I did. 1....
4
by: =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?= | last post by:
Hi; When my ASP.NET app is running on IIS, where does the Console.Out.WriteLine("hi there"); output go? -- thanks - dave david_at_windward_dot_net http://www.windwardreports.com
3
by: TC | last post by:
I'm trying to debug a console application, but I can't see the console output. I've seen many references which say that console output is supposed to appear on the Output window when the...
0
by: shravagiparag | last post by:
Hello, I am developing a console application to invoke gdb session and log in the communication between my application and gdb. I opened gdb as a new process and tried to redirect the input and...
6
by: =?Utf-8?B?R3JlZw==?= | last post by:
I am using the following command to output my results to the Output window (for testing things out). Console.WriteLine ("Output") I'd like to clear the Output window of any previous output. I...
1
by: mquincey | last post by:
One of the features offered by .NET 2.0 is the use of the TraceSource class. In an attempt to demonstrate its use, I wanted to run my test under the following conditions: 1. Use TraceSource class...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.