Thread: printing message to command line

  1. #1
    Registered User
    Join Date
    Jan 2012
    Posts
    2

    printing message to command line

    Hi,
    I have a c program test.c that is build into a test.exe I have an external program that calls test.exe. I would like to debug test.c by placing some print messages. I have only been able to print to a file. I would like to print the message onto some kind of console. I have tried fprintf(stderr,) fprintf(stdout,). What command must I use? How does c know to print to a command window that is already open?

    Thanks
    Lefti

  2. #2
    - - - - - - - - oogabooga's Avatar
    Join Date
    Jan 2008
    Posts
    2,808
    Usually a program will print to the command window that it was launched from.

  3. #3
    Registered User
    Join Date
    Jan 2012
    Posts
    3
    You can use AllocConsole function
    Read more about it using AllocConsole function


    Cheers,
    Saurabh

  4. #4
    Registered User
    Join Date
    Jan 2012
    Posts
    17
    Is there a reason why printf() wouldn't be appropriate?

  5. #5
    Registered User
    Join Date
    Jan 2012
    Posts
    17
    Wait a min... are you compiling it as a windows program?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Modifying and Printing Command Line Arguments
    By rjw2122 in forum C Programming
    Replies: 4
    Last Post: 10-15-2011, 05:21 PM
  2. Command line how to handle optional command.
    By ovid in forum C++ Programming
    Replies: 1
    Last Post: 03-07-2010, 11:41 PM
  3. printing & sending error message
    By aama100 in forum C++ Programming
    Replies: 5
    Last Post: 01-27-2008, 02:10 AM
  4. Message printing problem
    By robert_sun in forum C Programming
    Replies: 1
    Last Post: 05-18-2004, 05:05 AM
  5. Problem with Printing message
    By robert_sun in forum C Programming
    Replies: 2
    Last Post: 05-16-2004, 02:09 PM