   Run C++ program from command
  Ok, so I am suppose to have my c++ program be able run from command. Basically it will be tested like this:> g++ -o Solve Solve.cpp> Solve solve.txtThis is print out some computation done on solve.txtBasically I will have some code like this:void main(){char fileName[50];get_result(fileName);system("pause");}where filename will be solve.txt. Please help! How can I make this work? Do I need to args stuff in main( ??Thanks!   
  basically, you need to specify program arguments in main(...).int main(unsigned int argc, char **args){  for( int i = 0; i < argc; i++)  {cout << args << endl;  }}Quote:Do I need to args stuff in mainIf you're using args as a verb that means to specify variable names for the argument count and argument list pointer, than yes.   ;  I can't even get far enough to test.When I type at the correct file location:> g++ -o Solve Solve.cppI get error:'g++' is not recognized as an internal or external command, operable program or batch file.What does this mean?   ;Quote:Original post by musafir2007I get error:'g++' is not recognized as an internal or external command, operable program or batch file.What does this mean?It means you either don't have the GCC toolchain installed, or g++ is not on your PATH. [Re]install GCC. Are you on Windows? Then you'll probably have to install Cygwin.   