I need to know the syntax of how i can read a string from a file without using char array or char variable.
i want to declare a variable of string type but its giving error .
I have include <cstring>,<ctype> libraries.
int main()
{
string s1;
ifstream fin
fin.open("myfile.txt");
while( !fin.eof())
{
fin>>s1; // this line is giving error
}
fin.close();
return 0;
}