Correct the following code segment so that it opens the file
Correct the following code segment so that it opens the file whose name is entered the input statement. ifstream inData; string name; cout
Solution
14.
ifstream inData;
string name;
cout << \"Enter the name of the file: \");
cin >> name;
inData.open( name.c_str() );
15.
Question not complete. If it is asking what happens when file with provided name doesn\'t exist and we take input from it, it returns nothing i.e. no change is made to the variable for which input value is being read
16.
False. ifstream doesn\'t outputs any error message
