Click here to Skip to main content
16,010,334 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: My program will not execute. Pin
Christian Graus13-Dec-02 9:49
protectorChristian Graus13-Dec-02 9:49 
GeneralRe: My program will not execute. Pin
Gary Kirkham13-Dec-02 10:36
Gary Kirkham13-Dec-02 10:36 
GeneralRe: My program will not execute. Pin
Michael Dunn13-Dec-02 15:32
sitebuilderMichael Dunn13-Dec-02 15:32 
QuestionHow to display a string vertically? Pin
Vincent Ye13-Dec-02 8:31
Vincent Ye13-Dec-02 8:31 
AnswerRe: How to display a string vertically? Pin
Gary Kirkham13-Dec-02 10:46
Gary Kirkham13-Dec-02 10:46 
AnswerRe: How to display a string vertically? Pin
Alvaro Mendez13-Dec-02 11:02
Alvaro Mendez13-Dec-02 11:02 
GeneralRe: How to display a string vertically? Pin
Vincent Ye13-Dec-02 17:44
Vincent Ye13-Dec-02 17:44 
Generaldeleting a node Pin
Anonymous13-Dec-02 8:07
Anonymous13-Dec-02 8:07 
For some reason when i try to delete a node and print out the remaining list its prints a bunch of numbers i dont need

The list after deleting 92:
6685124 82 62 72 99

The list after deleting 72:
6685124 82 62 7801996 99

i need it to display like this

The list after deleting 92:
82 62 72 99

The list after deleting 72:
82 62 99

u can see what i need to get rid of.
heres is some code that i think could be the problem, and by the way this list is circular! if this isent enough code please say so



void ClosedList::Delete(int item)

{

NodeType* delPtr;

NodeType* currPtr;

if (item == head->component)

{

delPtr = head;

head = head->link;

}

else

{

currPtr = head;

while (currPtr->link->component != item)

{

currPtr = currPtr->link;

}

delPtr = currPtr->link;

currPtr->link = currPtr->link->link;

}

delete delPtr;

}

here is my print function



void ClosedList::Print() const

{

NodeType* currPtr = head->backlink;

if(!IsEmpty())

{

do

{

cout << currPtr->component << " ";

currPtr = currPtr->backlink;

}while (currPtr!= head);

cout << currPtr->component << " ";

}

cout <<endl;



bool ClosedList::IsEmpty() const

{

return (head == NULL);

}

GeneralRe: deleting a node Pin
Nick Parker13-Dec-02 8:33
protectorNick Parker13-Dec-02 8:33 
GeneralMSFledGrid...Help Pin
Anonymous13-Dec-02 8:06
Anonymous13-Dec-02 8:06 
Generaliostream Pin
will138313-Dec-02 7:51
will138313-Dec-02 7:51 
GeneralRe: iostream Pin
Nick Parker13-Dec-02 8:19
protectorNick Parker13-Dec-02 8:19 
GeneralRe: iostream Pin
will138313-Dec-02 8:29
will138313-Dec-02 8:29 
GeneralSearches Pin
will138313-Dec-02 7:49
will138313-Dec-02 7:49 
GeneralRe: Searches Pin
Alvaro Mendez13-Dec-02 8:15
Alvaro Mendez13-Dec-02 8:15 
GeneralRe: Searches Pin
will138313-Dec-02 8:27
will138313-Dec-02 8:27 
GeneralRe: Searches Pin
Alvaro Mendez13-Dec-02 9:16
Alvaro Mendez13-Dec-02 9:16 
GeneralRe: Searches Pin
will138313-Dec-02 9:41
will138313-Dec-02 9:41 
GeneralRe: Searches Pin
Todd Smith14-Dec-02 17:34
Todd Smith14-Dec-02 17:34 
GeneralLast directory visited Pin
doctorpi13-Dec-02 6:30
doctorpi13-Dec-02 6:30 
GeneralRe: Last directory visited Pin
Gary Kirkham13-Dec-02 6:55
Gary Kirkham13-Dec-02 6:55 
GeneralRe: Last directory visited Pin
Ravi Bhavnani13-Dec-02 9:38
professionalRavi Bhavnani13-Dec-02 9:38 
GeneralRe: Last directory visited Pin
Gary Kirkham13-Dec-02 10:29
Gary Kirkham13-Dec-02 10:29 
GeneralRe: Last directory visited Pin
Ravi Bhavnani13-Dec-02 11:30
professionalRavi Bhavnani13-Dec-02 11:30 
GeneralWindows Forms Open File Dialog Pin
KBL13-Dec-02 6:08
KBL13-Dec-02 6:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.