I need to write a program that receives an executable file path as the first argument, check if the the file exists and that it is executable. #include <iostream> using namespace std; int main (int argc, const char * argv[]){ cout << "# Arguments: " << argc << endl; for (int i = 0; i ..
Category : argc
So I have a txt file that looks like this. Input1.txt ! awesome is Joseph guess I the main point is to create a code that will rearrange the inputs into a readable sentence like this answ1.txt I guess Joseph is awesome ! I have my code here lab.txt #include <iostream> #include <fstream> using namespace ..
I’m trying to open my a text file and read from it using argv[] when I use ifstream input (argv[1]) it doesn’t is there a way i can open the file using argv[1]? #include <iostream> #include <fstream> using namespace std; int main(int argc, char *argv[]) { string line; cout << argv[1]; ifstream input (argv[1]); while(getline(input, ..
Recent Comments