- //header->numFlowsPerRead = 800;
- header->flowChars = new char(header->numFlowsPerRead);
- //buffer = new char(header->numFlowsPerRead);
- cout << "here" << endl;
- in.read(header->flowChars, header->numFlowsPerRead);
- //string tempBuf1 = header->flowChars + '\0'; //this is in here because the read sometimes tacks on extra chars, not sure why?
- //if (tempBuf0.length() > header->numFlowsPerRead) { tempBuf1 = tempBuf1.substr(0, header->numFlowsPerRead); strcpy(header->flowChars, tempBuf1.c_str()); }
- //in.read(buffer, header->numFlowsPerRead);
- //memcpy(header->flowChars, buffer, header->numFlowsPerRead);
- //delete[] buffer;
- //cout << "here" << endl;
- //string tempBuf1 = header->flowChars;
- //cout << "here " << in.tellg() << endl;
- //if (tempBuf1.length() > header->numFlowsPerRead) { tempBuf1 = tempBuf1.substr(0, header->numFlowsPerRead); strcpy(header->flowChars, tempBuf1.c_str()); }
+ char tempBuffer [header.numFlowsPerRead];
+ in.read(tempBuffer, header.numFlowsPerRead);
+ header.flowChars = tempBuffer;
+ if (header.flowChars.length() > header.numFlowsPerRead) { header.flowChars = header.flowChars.substr(0, header.numFlowsPerRead); }