Reading from a file

This is a discussion on Reading from a file within the C++ Programming forums, part of the General Programming Boards category; I have a huge problem that i hope someone can answer. I have a written code that executes in a ...

  1. #1
    Registered User
    Join Date
    Jan 2006
    Posts
    3

    Question Reading from a file

    I have a huge problem that i hope someone can answer.
    I have a written code that executes in a console window and then i have another written program that needs to verify a text line in the other programs console window.
    Is that possible to do, How can i do that?

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,535
    Which OS?
    Which compiler?
    Did you write the code for both programs?

  3. #3
    Registered User
    Join Date
    Jan 2006
    Posts
    3

    Smile

    The program is running under windows2000.
    Its compiled with visual studio 6.0.
    I have only written one of the programs, the one that needs to read from the other programs console window.
    Is it possible to do?

  4. #4
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,535
    Well if your program is in control of running the other program, then you could do
    Code:
    FILE *fp = popen("other.exe","r");  /* maybe _popen in M$ */
    Then you can read it's output using fgets()

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. opening empty file causes access violation
    By trevordunstan in forum C Programming
    Replies: 10
    Last Post: 10-21-2008, 11:19 PM
  2. Formatting the contents of a text file
    By dagorsul in forum C++ Programming
    Replies: 2
    Last Post: 04-29-2008, 12:36 PM
  3. Replies: 3
    Last Post: 03-04-2005, 01:46 PM
  4. Possible circular definition with singleton objects
    By techrolla in forum C++ Programming
    Replies: 3
    Last Post: 12-26-2004, 09:46 AM
  5. System
    By drdroid in forum C++ Programming
    Replies: 3
    Last Post: 06-28-2002, 10:12 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21