Hi
I need to cast string type variable to LPCTSTR type. How to achieve this. I am inserting my code for yours help.
ifstream file(filename);
if (file)
{
char ch='\n' ;
do
{
file.getline(line, SIZE);
tmp =static_cast<string>(line);
vector <string> array;
string token; // token decleared string type
istringstream iss(tmp);
for (int i=1; i<6;)
{ while ( getline(iss, token, ',') )
{
array.push_back(token);
v_List.SetItemText(nItem, i, token);
/* token is of string type so compiler gives error that can't convert 'std::string' to 'LPCTSTR' */
i++;
}
}//cin.get();
}while(ch!='\n'); //(ch=EOF)
}
Any help please ..........