Name of a file redirecting the default C entry

Asked

Viewed 44 times

1

How to store a file name in a variable when redirecting to default entry without using argv.

Example of execution:

./a. out < filename.txt

  • This is not a question of shell?

  • No, the problem arises when I put the minor symbol to redirect the input, if the execution is . /a. out filename.txt the argc account 2 and account 1 executing . /a. out < filename.txt

  • Of course; redirecting is a feature of shell.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.