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

C / C++ / MFC

 
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 
GeneralRe: deleting a node Pin
Nick Parker13-Dec-02 8:33
protectorNick Parker13-Dec-02 8:33 
I just ripped this out of an old assignment, you might try something like this as I know it works. Keep in mind this is only for a singly linked-list.

int records::DeleteNode(double num)
{
  ListNode *NodePtr, *PreviousNode, *BufPtr;
  bool bIsFound;

  BufPtr = head;
  while(BufPtr != NULL)
  {
	if(BufPtr->ssan == num)
	{
	  bIsFound = true;
	}
	else
	{
	  bIsFound = false;
	}
	BufPtr = BufPtr->Next;

	if(bIsFound == true)
		BufPtr = NULL;

  }

  if(bIsFound == false)
	return -1;

  if(!head)
	return -1;

  if(head->ssan == num)
  {
	NodePtr = head->next;
	delete head;
	head = NodePtr;
  }
  else
  {
	NodePtr = head;
	while(NodePtr != NULL && NodePtr->ssan != num)
	{
	  PreviousNode = NodePtr;
	  NodePtr = NodePtr->next;
	}

	PreviousNode->next = NodePtr->next;
	delete NodePtr;
  }
  return 0;
}




Nick Parker

Not everything that can be counted counts, and not everything that counts can be counted. - Albert Einstein


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 
GeneralMFC vs. win32 Pin
naradaji13-Dec-02 5:50
naradaji13-Dec-02 5:50 

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.