I am not sure if the title of my thread indicates where the problem is, but that is what I think it is.
void convertFormat(vector<string>& files, map<string,int>& tickerMap, vector<int>& numRecords )
{
string txt = ".txt";
string filePathNameString;
for ( int k =0 ; k < (int)files.size(); k++)
{
filePathNameString = files[k];
// extract ticker from filename string
size_t start = filePathNameString.find_last_of("/");
size_t end = filePathNameString.find_last_of("_");
string ticker = filePathNameString.substr(start+1,end-start-1);
char * filePathName = (char *)(filePathNameString.c_str());
TAQTradesReader taq( filePathName );
}
}
where the constructor is of form
TAQTradesReader::TAQTradesReader( char * filePathName )
The problem is that this function compiles and runs properly in VS, but when I run on my Cygwin, I get a "segmentation fault(core dumped)". Can someone please help me.
The thing is if I change line 15 to this then I dont get the segmentation fault
TAQTradesReader taq( "C:/Users/abhishek/Desktop/Projects/TestTAQ/TAQ/20070620/MSFT_trades.binRT" );