I am writing a program that takes strings form a file and displays them in an edit box on a form. however when i try and output them i get the error message Cannot convert 'string' to 'AnsiString' I'm unsure of the difference and am not sure how to rectify this problem. Any suggestions would be appreciated. I've included the code if it helps.
Code:
string str;
ifstream myfile("Entry.txt");
if (!myfile)
{
ShowMessage ("Error opening file");
}
while (! myfile.eof())
{
getline(myfile,str);
Form1->Edit1->Text = str
getline(myfile,str);
Form1->Edit2->Text = str;
getline(myfile,str);
Form1->Edit3->Text = str;
getline(myfile,str);
Form1->Edit4->Text = str;
getline(myfile,str);
Form1->Edit5->Text = str;
}