#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
cout << argv[2] << endl;
}
This is just the beginning of a program that I'm writing, but I'm already stuck. It simply reads in data from a binary file that I have saved in the same directory as this program. I compile and run the program with ./a.out < filename, and the program is just supposed to print out whatever is in the file to stdout. I tried a different way by opening the file and using getline to get the data, and the data was received perfectly. I'm just wanting to know why the first method isn't working as intended and what I can do to fix this problem.