any idea why this raises an exception after executing the first line in the loop
if (!pCurr)
{
memset(pNew,0,sizeof(SYNLINE));
pCurr->pNext = pNew;
pNew->pPrev = pCurr;

pNew->dwLength = 1;
pNew->szLine = new char[2];
*(sed.pLines->szLine) = chr;
}
Posted on 2001-07-27 01:55:34 by MovingFulcrum
How did you declare pNew ? Is it big enough ( size >= sizeof(SYNLINE)) ?
Posted on 2001-07-27 02:30:34 by Dr. Manhattan
Sorry fro the late reply. Here is the correct code for everyone to see.Many thanks to Umbongo for helping me out




if (FirstTime==1)
{
sed.pLines->pNext = new SYNLINE;
memset(sed.pLines->pNext,0,sizeof (SYNLINE));
sed.pLines->pNext->szLine= new char[2];
memset(sed.pLines->pNext->szLine,0,2);
*(sed.pLines->pNext->szLine)=chr;
sed.pLines->pNext->dwLength=1;
FirstTime=0;
}
Posted on 2001-07-30 14:44:32 by MovingFulcrum