Thread: saving output of c as a txt file

  1. #1
    Registered User
    Join Date
    Feb 2015
    Location
    Chennai, Tamil Nadu, India
    Posts
    1

    Post saving output of c as a txt file

    My project involves writing a c program to generate a set of 70 decimal numbers. I want to save the output (these 70 numbers) as a txt file. I tried the following:

    1. prt scr of output screen and pasting it in notepad. NOT WORKING
    2. going to DOS SHELL and doing the following:
    c:\TC\BIN>output.exe>>output.txt
    NOT WORKING. Text file is generated, but it does not contain output. It just says:
    illegal command: output.exe

    What do I do?

    Thanks

  2. #2
    Programming Wraith GReaper's Avatar
    Join Date
    Apr 2009
    Location
    Greece
    Posts
    2,738
    Devoted my life to programming...

  3. #3
    Registered User
    Join Date
    May 2011
    Location
    Around 8.3 light-minutes from the Sun
    Posts
    1,949
    Why don't you just write to a file if that is what the true endpoint of the program is? Take a look at C File I/O Tutorial - Cprogramming.com
    Quote Originally Posted by anduril462 View Post
    Now, please, for the love of all things good and holy, think about what you're doing! Don't just run around willy-nilly, coding like a drunk two-year-old....
    Quote Originally Posted by quzah View Post
    ..... Just don't be surprised when I say you aren't using standard C anymore, and as such,are off in your own little universe that I will completely disregard.
    Warning: Some or all of my posted code may be non-standard and as such should not be used and in no case looked at.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. File handing and saving records to file problem
    By loveable in forum C Programming
    Replies: 18
    Last Post: 12-29-2012, 09:53 AM
  2. Saving number Output
    By Apocalyptic_end in forum C++ Programming
    Replies: 37
    Last Post: 01-26-2008, 05:16 PM
  3. Saving output
    By Rossco in forum C Programming
    Replies: 16
    Last Post: 11-30-2007, 03:01 AM
  4. Saving screen output to file
    By Gkitty in forum C Programming
    Replies: 7
    Last Post: 12-20-2002, 12:38 AM
  5. Saving a File
    By Krush in forum C Programming
    Replies: 1
    Last Post: 11-23-2002, 02:08 AM

Tags for this Thread