Hi Guys,
I am using visual studio 2009 using vc++. I am reading from a text file using a streamReader one line at a time. The data is tab delimited. I am trying to split the data and then stuff all the strings into struct. Here's what I am doing
struct
{
std::string day;
std::string month;
std::string year:
}cal;
cal newRecord;
main()
{
StreamReader^ file = gcnew StreamReader("c:\\txtFile.txt");
String^ del = "\t"
array<String^>^delim = del->ToCharArray();
array<String^>^line = file->ReadLine()->Split(delim,3);
newRecord = (cal*)line;
}
Data Read: 1\tjan\t2010
So every thing upto reading in the data and splitting it works. But when I try to type cast to the struct I get the error:
error c2440 type cast : cannot convert from 'cli::array<Type> ^ ' to 'cal*'
I am totaly stuck here. Any help will be appreciated.