Say I had the following Java Method, in the class "Reader":
public static String read(String filePath) {
BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(new File(filePath))));
String contents = "";
String line = null;
while ((line = br.readLine()) != null) {
contents += "\r\n" + line;
}
return contents;
}
How would I use C++ to execute Reader.read("PathToFile")? I need to be able to pass it the path to the file, and get the result.
I know I can execute it using System(), but as far as I know, you cannot pass it a value through the command prompt. Nor can you receive a result