Home > Back-end >  C when reading the file path problem
C when reading the file path problem

Time:10-06



Want to ask next group bosses how this exe executable program implementation, to read the file directly into the line



How do I write my own code to modify to achieve the above in that way, you don't have to write file location in application to death

CodePudding user response:

Define a string, read from the input stream path defined ifstream is initialization parameters for the string

CodePudding user response:

String s;
Cout<" Input laser file path: ";
Cin> s;
Ifstream iFilel (s);

CodePudding user response:


Command line input program very basic introduction, gets the scanf and so on

CodePudding user response:

String s input s again

CodePudding user response:

The string filename.
Cin & gt; & gt; The filename.

Ifstream infile.
Infile. Open (filename, "r");

CodePudding user response:

refer to the second floor 燚 recognition response:
string s.
Cout<" Input laser file path: ";
Cin> s;
Ifstream iFilel (s);

Thank you for your advice on the
  • Related