C/Visual C - dudas sobre apuntadores(2)

 
Vista:

dudas sobre apuntadores(2)

Publicado por gerardo (2 intervenciones) el 04/04/2003 03:57:02
=======================================
y el siguiente:
VOID CGraphics::CopyListFrom(CShape* copyFrom, CShape *copyTo)
{
CShape *aux, *originalList;

aux=copyFrom;
originalList=copyTo;
assert(aux!=NULL);
assert(originalList!=NULL);

while((originalList->Get_Next())!=NULL)
originalList=originalList->Get_Next();

while((aux->Get_Next())!=NULL)
{
CShape* newNode;
aux=aux->Get_Next();
newNode = new CShape;
// copiar todos los datos desde aux
newNode->Set_Next(NULL);
newNode->Set_Prev(originalList);
originalList->Set_Next(newNode);
newNode=NULL;
originalList=originalList->Get_Next();
}
}
=======================================

Gracias de antemano,
Gerardo.
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder