CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Apr 2006
    Posts
    15

    file output into file?

    Hello. I need to find a way to route the output of my program into a file. Let's say I compiled a simple .CPP file. After starting it, I want the output to be stored in a text file.
    I tried to achieve that through the command prompt with: program.exe > output.txt, but that doesn't help me, as my .cpp program has a small menu, and needs keyboard input.

    Any help is appreciated

  2. #2
    Join Date
    Oct 2005
    Location
    Bangalore
    Posts
    1,051

    Re: file output into file?

    How to spawn console processes with redirected standard handles
    There are also a lot of threads that have ben discussed in this forum, a search should give u many hits
    - Sreehari
    "Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us."
    " Everybody is sent to Earth on a purpose. I am so Lagging behind that i won't die." – Calvin

  3. #3
    Join Date
    Apr 2006
    Posts
    15

    Re: file output into file?

    thank you

  4. #4
    Join Date
    Jul 2005
    Location
    Germany
    Posts
    1,194

    Re: file output into file?

    Is there a way to redirect standard handles of the current process rather than of a child process?
    Please don't forget to rate users who helped you!

  5. #5
    Join Date
    Oct 2002
    Location
    Timisoara, Romania
    Posts
    14,360

    Re: file output into file?

    What "output" exactly do you want to redirect?
    Marius Bancila
    Home Page
    My CodeGuru articles

    I do not offer technical support via PM or e-mail. Please use vbBulletin codes.

  6. #6
    Join Date
    Apr 2001
    Location
    Tampa Florida
    Posts
    233

    Re: file output into file?

    Hello
    I dont get it, why dont you just open a file?
    search help for FILE * or the newer CFile class
    Regards
    "trampling out the vintage"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured