I'm trying to open a txt file using command line arguments in Visual C++. I know you need argc and argv[] in the main. What would be an example you would type into the text field on project>properties>debugging>command arguments? How would you display the text on screen? After reading the txt file, I need to sort it. That is another step I will deal with latter.
Thank you.
this is what I have so far. The comments are how I am interpreting the code.
#include <iostream>
using namespace std;
int main(int argc, char* argv[])
{
cout << "argc = " << argc << endl; //argc is the number of elements argv[] contains
//if you enter more text into command arguments, argc will get larger
cout << "argv[0] = " <<argv[0] << endl; //argv[0] is the file name and location
cout << "argv[1] = " << argv[1] << endl; //argv[1] is the text entered into the text field
}