C/C++の宿題を片付けます 77代目
■ このスレッドは過去ログ倉庫に格納されています
0720デフォルトの名無しさん
2006/11/30(木) 20:16:25以下と差し替えて DeleteAlist() の戻り値が0なら no such data, 1以上なら data found と表示すればよろし
int DeleteAlist( struct LIST** ppList, int iDelKey )
{
LIST* pTmp;
int iDelNum = 0;
while( *ppList ) {
if( (*ppList)->data == iDelKey ) {
pTmp = (*ppList)->nextptr;
free( (void*)*ppList );
*ppList = pTmp;
iDelNum++;
}
else {
ppList = &((*ppList)->nextptr);
}
}
return iDelNum;
}
■ このスレッドは過去ログ倉庫に格納されています