Thread: Writing all program output to a txt file in C

  1. #1
    Registered User
    Join Date
    Nov 2016
    Posts
    1

    Question Writing all program output to a txt file in C

    I have to write all program output to a txt file in C. How is it done?

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    Well most decent command line shells allow you to redirect the standard streams.

    So for example
    myprog > results.txt
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 4
    Last Post: 09-01-2014, 08:14 AM
  2. Writing output to a seperate file? Or something?
    By sseppala in forum C Programming
    Replies: 5
    Last Post: 02-06-2012, 11:50 AM
  3. Writing Output to a File
    By portable in forum C Programming
    Replies: 10
    Last Post: 01-15-2008, 03:54 AM
  4. Writing to an Output Socket in use by another program
    By maththeorylvr in forum Windows Programming
    Replies: 4
    Last Post: 10-28-2005, 12:17 PM
  5. writing to output file
    By Unregistered in forum C++ Programming
    Replies: 2
    Last Post: 01-08-2002, 02:23 PM

Tags for this Thread