saving output

Posted on 2005-04-30
Last Modified: 2010-04-15
I want 2 save the output of my c program after running it and later send it to a can i save the output?
Question by:shilpi84
    LVL 23

    Accepted Solution

    You can redirect the output to a file using stdout redirection:

    myprogram > aFile

    If you need to see the output on the console AND capture it to a file, use the 'tee' command:

    myprogram | tee aFile

    LVL 45

    Expert Comment

    Hi shilpi84,

    Note that you'll have to write to stdout.  You can NOT use the terminal I/O routines.

    Good Luck!
    LVL 4

    Expert Comment


    if u r runnnig windows

    run the console window (dos window) in full screen mode

    press print screen  ( the button to the right of Function keys)

    now open notepad
    paste it ( Ctrl + V ) in notepad and save it

    Expert Comment

    Which operating system are u using?

    If Linux use
              > ./a.out filename > outputfile
              > cat outputfile

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Join & Write a Comment

    Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode ( They will have you believe that Unicode requires you to use…
    This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
    The goal of this video is to provide viewers with basic examples to understand and use pointers in the C programming language.
    The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now