I am trying to read input for a C program (that expects input from the user) from a file using the shell command:
progname < filename
but it seems that the program considers the char '<'
as the first input, hence causing an "error" in my program.
I checked it with another program and it seems to work properly.
any idea waht could be wrong?
Post your code within code tags.
Regards
Are you :-
a) taking an argument on the command line and explicitly opening the filename specified in the program?
or
b) is your C program reading standard input?
From your description, it sounds like the program is written assuming (a) but you're attempting to run it assuming (b) i.e. the '<' is causing the shell to open the file and redirect it to your program as STDIN.
As Franklin52 says, a code fragment would clarify things.
Hope that helps.
Jerry