Program Not Producing Output

This is a discussion on Program Not Producing Output within the C Programming forums, part of the General Programming Boards category; Hi So I have a basic program that uses a Code: system("filepath\input.hnb"); command to open up a file and run ...

  1. #1
    Registered User
    Join Date
    Mar 2011
    Posts
    18

    Program Not Producing Output

    Hi

    So I have a basic program that uses a
    Code:
    system("filepath\\input.hnb");
    command to open up a file and run it using its default program (a simulation program). My simulation is able to finish, but does not produce the output that it usually does (it produces .dat files contain data of the simulation run in the same folder as the simulation .hnb file) (when I run the simulation outside of my C program it produces output just fine). I am thinking that this may have something to do with the permissions of my C program. Any thoughts/advice? Thanks
    Last edited by lebronlin; 04-28-2011 at 01:03 PM.

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,762
    Use say getcwd() to find out what the current directory is when you call system()
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Registered User
    Join Date
    Mar 2011
    Posts
    18
    Hahahaha thanks.....I feel really stupid, I can't believe I didn't check the program file directory for the output, instead of the simulation file directory

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Supreme Court - Producing IDs to police
    By Thantos in forum A Brief History of Cprogramming.com
    Replies: 23
    Last Post: 06-22-2004, 07:37 PM
  2. Producing Beep Sound with C++
    By ron4ldk in forum C++ Programming
    Replies: 8
    Last Post: 05-01-2004, 02:05 AM
  3. Help producing sine wave
    By ricky1981 in forum C++ Programming
    Replies: 9
    Last Post: 10-31-2003, 09:20 PM
  4. Producing a random number
    By Dauthi in forum C++ Programming
    Replies: 2
    Last Post: 09-03-2002, 08:25 AM
  5. producing random numbers???
    By esilja in forum C++ Programming
    Replies: 3
    Last Post: 10-19-2001, 08:48 PM

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