all my code seemed okay but for some reason it was incapable of accepting string data types, i experimented using both int and double data types and they worked perfectly. So my question is how do i make a string data type usable in my program?
Here's some code
1] Save slot
Code: Select all
void projectcalciFrame::OnButton11Click(wxCommandEvent& event)
{
string x;
TextCtrl1->GetValue().ToStdstring((&x));
Ofstream myfile("widgets.txt");
myfile<<x;
myfile.close();
}
Code: Select all
void projectcalciFrame::OnButton11Click(wxCommandEvent& event)
{
ifstream myfile ("widgets.txt");
string x;
while(myfile>>x){
wxstring res = wxT(" ")
res<<x;
TextCtrl1->SetValue(res);
}
}.