I had an existing c++ program that I compiled in Ubuntu 14.04 using g++-4.8. To run this program on the terminal by passing it a file, which prints processed data in the console:

#./my_program.cpp.exe < data.in

EMPLOYEE ID IS            1
MARITAL STATUS IS         s
YOUR GROSSPAY IS          100
YOUR TAX AMOUNT IS        5
YOUR NETPAY IS            95

This program is stored in ~/Documents/module2. I created a new directory ~/Documents/module3 and copied both files, my_program.cpp.exe and data.in, to this folder and now when I run it, it doesn't print any output to the console.

#./my_program.cpp.exe < data.in
#

I'm not sure if this is a c++ issue or a Linux/Ubuntu issue so I'm asking here. I feel like it could be either or them.

When I list the files they show:

#ls
-rw-r--r-- 1 user    user
-rwxr-xr-x 1 user    user    my_program

... plus other files (11 total)

but when I list the folders they come up as:

drwxr-xr-x  2 user    user    module3
drwxrwxr-x  3 user    user    module2

which I'm not sure if that 2 after the permissions makes sense.

to get info from the file I'm using:

ifstream fin( "employee.txt" ); // Declare file streams

no so no hardcoded links other than the same dir where running the program. All I do afterwards is basic math and print to standard output:

cout << " EMPLOYEE ID IS            " << employeeid << endl;

I "diff-ed" both files (data.in and my_program.cpp.exe) with the originals and they are identical.

Thanks for any help!

share|improve this question
    
Without seeing any relevant code it's impossible to answer this question. Please learn how to create a Minimal, Complete, and Verifiable Example. – Some programmer dude Apr 25 '16 at 5:12
1  
Did you try to debug? – Naveen Apr 25 '16 at 5:13
    
Note: The 2 and the 3 after permissions are the number of sub-directories, including . and ... – Jonny Henly Apr 25 '16 at 5:17
    
@JoachimPileborg I added more info about how it reads from the file and how it prints to stdo. – user3325563 Apr 25 '16 at 5:26
1  
Please update your question to include an actual Minimal, Complete, and Verifiable Example, and also a full directory list of both directories, with file sizes (i.e. ls -l). – Some programmer dude Apr 25 '16 at 5:40

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.