Dear all , I have this problem, I need to set the path of a file object from the user using cin.getline, but I face a problem , please comment
Code:int main(int argc, char *argv[]) { char file_name[40]; if(argc == 1) {cout << "You can to pass in a file name to the program via the command line, " << " or type it down\n file : "; cin.getline(file_name,39); input_code.open(file_name); } else input_code.open(argv[1]); return 0; }