inputing a file to a c++ program

So say I have a program called detect_cycle.cpp

Then I compile it and name it detect_cycle

Then from my unix terminal I type:

detect_cycle < data_file

where data_file is in the same directory as my detect_cycle executable.

What would I write in main so that I would know what file the user is specifying. For example they could have written

detect_cycle < data_file_2

Then I would need main to know that it is data_file_2
Since the clone thread in the Beginner's forum got a reply first:
http://cplusplus.com/forum/beginner/23674/

-Albatross
Topic archived. No new replies allowed.