Press 'F5' to compile and run the program. The console window will open automatically.
I think u misunderstood me. I need to open the exe file in the console and add another txt file to the program so that the program can read the data from the file.
e.g. C:\> sample < sample.inn
But I can't this exe file in the directory
You have lots of choices. niek_e has given the outline of one way. Others would include.
1) Identify the file to read.
This may be as simple as the file name and extension if the file is in the same directory as the exe of the program or it may be a formal path starting with the drive name followed by each directory and subdirectory until you get to the file name and extension. This information may be: entered by the user at the command prompt or entered by the user when prompted by the program or read from a given file of file names or from some other source.
2) associate the file identity with a file stream.
The file identity must be in the form of a C style string. It may be associated with the file stream at declaration of the file stream or by using the open() stream method. For example: