question about programs accessing the outputs of different programs

This is a discussion on question about programs accessing the outputs of different programs within the C++ Programming forums, part of the General Programming Boards category; i have a program, assembler, that reads from a text file,sort.s, containing a bubble sorter in mips assembly language, assembles ...

  1. #1
    Registered User
    Join Date
    Oct 2009
    Posts
    6

    question about programs accessing the outputs of different programs

    i have a program, assembler, that reads from a text file,sort.s, containing a bubble sorter in mips assembly language, assembles it, and then writes the output to a different text file, output.o (extensions don't matter). i am currently writing a program, simulator, that then needs to read output.o and execute the instructions in it. i was wondering how i might go about this? can i simply copy/paste the simulator as a new source file in assembler?
    right now, assembler reads sort.s from the Desktop\Assembler\Assembler folder, and writes output.o to the same place. so if i put simulator.cpp in that folder, will it work? or do i need to go to project>add new item from within MSVS itself? (i havent experience working on programs that have multiple parts)

    i hope thats clear enough...

    thanks

  2. #2
    Registered User C_ntua's Avatar
    Join Date
    Jun 2008
    Posts
    1,853
    You can open whatever file you want, no matter its location. Just specify the correct location in the disk. Usually, if a specific location is not specified it looks at the current folder location (where the simulator.cpp is).

    Example (sth like this for XP)
    Code:
    ifstream in("C:\\Windows\\Documents and Settings\\User_Name\\Desktop\\Assembler\\Assembler_Folder\\output.o");
    If you put
    Code:
    ifstream in("output.o");
    then it most likely look for output.o in the folder that simulator.cpp is.

    Note that you need \\ not \

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. another exercise question
    By luigi40 in forum C# Programming
    Replies: 3
    Last Post: 11-28-2005, 02:52 PM
  2. Need help with some C programs. (VERY Long Post)
    By McFury in forum C Programming
    Replies: 9
    Last Post: 04-30-2004, 12:33 PM
  3. Accessing Void Function Question
    By liquidspaces in forum C++ Programming
    Replies: 2
    Last Post: 03-27-2003, 01:06 PM
  4. Very simple question, problem in my Code.
    By Vber in forum C Programming
    Replies: 7
    Last Post: 11-16-2002, 02:57 PM
  5. what does this warningmean???
    By kreyes in forum C Programming
    Replies: 5
    Last Post: 03-04-2002, 06:53 AM

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