Click here to Skip to main content
15,909,939 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Check box background color Pin
Nibu babu thomas29-Mar-06 22:17
Nibu babu thomas29-Mar-06 22:17 
GeneralRe: Check box background color Pin
snir_ya29-Mar-06 22:29
snir_ya29-Mar-06 22:29 
GeneralRe: Check box background color Pin
snir_ya29-Mar-06 22:38
snir_ya29-Mar-06 22:38 
GeneralRe: Check box background color Pin
snir_ya29-Mar-06 22:59
snir_ya29-Mar-06 22:59 
AnswerRe: Check box background color Pin
Hamid_RT30-Mar-06 0:48
Hamid_RT30-Mar-06 0:48 
GeneralRe: Check box background color Pin
snir_ya30-Mar-06 0:54
snir_ya30-Mar-06 0:54 
AnswerRe: Check box background color Pin
Hamid_RT30-Mar-06 1:30
Hamid_RT30-Mar-06 1:30 
QuestionLinked list problem Pin
sheepdonkey29-Mar-06 20:40
sheepdonkey29-Mar-06 20:40 
Hi,

I have created a class for implementing a doubly linked list. The problem I having is when I'm inserting a new node into the list.

First off, in a function in my class, I create a temporary node and copy the data into it like so:
<br />
PNODE pTempNode;<br />
pTempNode = new NODE;<br />
pTempNode->pNext = NULL;<br />
pTempNode->pPrev = NULL;<br />
pTempNode->pData = new double[dataSize];<br />
<br />
//fill with data<br />
<br />
pTempList->Insert(pTempNode);  // Pass the node to insert into the list<br />


The insert function then adds this node to the list like so:
<br />
if(pHead == NULL)	//	If there is no nodes in the list<br />
{<br />
	pHead = pNew;<br />
	pTail = pNew;<br />
	return;<br />
}<br />
else<br />
{<br />
        // (code not included for question)<br />
        // find a place to insert based on a condition<br />
<br />
        pPrev->pNext = pNew;<br />
	pNew->pNext = pCurr;<br />
	pNew->pPrev = pPrev;<br />
<br />
}<br />


Problem is though the head always changes to the new node I pass before I have passed it so the new node is not replacing the head.

Thanks for any help and I hope this makes sense!

Dave
AnswerRe: Linked list problem Pin
benjymous29-Mar-06 21:21
benjymous29-Mar-06 21:21 
GeneralRe: Linked list problem Pin
sheepdonkey29-Mar-06 22:39
sheepdonkey29-Mar-06 22:39 
GeneralRe: Linked list problem Pin
Rage29-Mar-06 23:56
professionalRage29-Mar-06 23:56 
QuestionCreating DLL to automate MSword Pin
KongHL29-Mar-06 20:38
KongHL29-Mar-06 20:38 
AnswerRe: Creating DLL to automate MSword Pin
Ganesh_T29-Mar-06 22:00
Ganesh_T29-Mar-06 22:00 
QuestionIs there any way to make single exception handler? Pin
dmivlad29-Mar-06 20:02
dmivlad29-Mar-06 20:02 
AnswerRe: Is there any way to make single exception handler? Pin
Stephen Hewitt29-Mar-06 20:15
Stephen Hewitt29-Mar-06 20:15 
GeneralRe: Is there any way to make single exception handler? Pin
Cedric Moonen29-Mar-06 20:21
Cedric Moonen29-Mar-06 20:21 
GeneralRe: Is there any way to make single exception handler? Pin
dmivlad29-Mar-06 20:22
dmivlad29-Mar-06 20:22 
GeneralRe: Is there any way to make single exception handler? Pin
Stephen Hewitt30-Mar-06 11:13
Stephen Hewitt30-Mar-06 11:13 
AnswerRe: Is there any way to make single exception handler? Pin
Cedric Moonen29-Mar-06 20:20
Cedric Moonen29-Mar-06 20:20 
Questionping Pin
J512198229-Mar-06 19:55
J512198229-Mar-06 19:55 
AnswerRe: ping Pin
Trollslayer29-Mar-06 21:50
mentorTrollslayer29-Mar-06 21:50 
Questionhow to run batch file Pin
aaaan29-Mar-06 19:47
aaaan29-Mar-06 19:47 
AnswerRe: how to run batch file Pin
Cedric Moonen29-Mar-06 20:23
Cedric Moonen29-Mar-06 20:23 
QuestionHelp needed - How do i launch all items in Desktop folder? Pin
giftsana29-Mar-06 19:34
giftsana29-Mar-06 19:34 
AnswerRe: got solution! Pin
giftsana29-Mar-06 20:59
giftsana29-Mar-06 20:59 

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.