Hi I'm little bit hard to understand what that the compiler says
[BCC32 Error] frmNew.cpp(333): E2285 Could not find a match for 'std::getline<_Elem,_Traits,_Alloc>(ifstream,std::vector >)' Full parser context frmNew.cpp(303): parsing: void _fastcall TFrmNewPeta::showDefaultRute()
I'm using std::vector<std::string>mystring
to stored my strings file. but this code
while (std::getline(ifs_Awal, mystring))
I get the error.
this is my complete code
void __fastcall TFrmNewPeta::showDefaultRute()
{
std::string mystring;
std::ifstream ifs_Awal;
int tempIndexAwal = 0;
ifs_Awal.open("DefaultDataAwal");
while (std::getline(ifs_Awal, mystring)) {++tempIndexAwal;}
std::vector<std::string> mystring(tempIndexAwal);
while (std::getline(ifs_Awal, mystring)) // error
{
mystring.push_back(mystring); // error
}
ifs_Awal.close();
}
I'm using c++ builder 2010
in many tutorials they prefer to using std::vector to store string to dynamic array. so I did the same ways, but this happened when I try using std::vector<>