a line from a text file is
"mere thinking is nothing" 50
now is there any function by which i can save the contents from the line between the two quotes only into a character array variable
Printable View
a line from a text file is
"mere thinking is nothing" 50
now is there any function by which i can save the contents from the line between the two quotes only into a character array variable
Use the ignore functonality to skip the first quotation mark, then read in the string using the getline function while specifying the quotation mark as the delimiter.
DavidCode:#include <iostream>
#include <fstream>
using namespace std;
int main()
{
ifstream inText("message.txt", ios::in);
char message[50] = {'\0'};
inText.ignore(1);
inText.getline(message,50,'"');
inText.close();
cout << message << endl;
return 0;
}