Click here to Skip to main content
14,931,694 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionCToolBarCtrl help Pin
fantasy12151-Sep-08 16:31
Memberfantasy12151-Sep-08 16:31 
QuestionCAsyncSocket fails after a few successful OnReceive()'s Pin
EvoWing1-Sep-08 14:28
MemberEvoWing1-Sep-08 14:28 
AnswerRe: CAsyncSocket fails after a few successful OnReceive()'s Pin
EvoWing2-Sep-08 3:55
MemberEvoWing2-Sep-08 3:55 
GeneralRe: CAsyncSocket fails after a few successful OnReceive()'s Pin
Mark Salsbery2-Sep-08 7:05
MemberMark Salsbery2-Sep-08 7:05 
QuestionRe: CAsyncSocket fails after a few successful OnReceive()'s Pin
EvoWing7-Sep-08 4:55
MemberEvoWing7-Sep-08 4:55 
QuestionRe: CAsyncSocket fails after a few successful OnReceive()'s Pin
Mark Salsbery8-Sep-08 8:17
MemberMark Salsbery8-Sep-08 8:17 
Questionconcatenate linked list of characters Pin
Sadaiyappan1-Sep-08 13:27
MemberSadaiyappan1-Sep-08 13:27 
AnswerRe: concatenate linked list of characters Pin
Robert.C.Cartaino1-Sep-08 14:51
MemberRobert.C.Cartaino1-Sep-08 14:51 
Sadaiyappan wrote:
I am trying to implement the concatenate function and I have no clue how to do so.


There are two ways, depending on how you want concatenate() to work. If you want to copy the data from your second list and append it to the end of the first list, simply traverse the second list, extract the value and use your insert() method to append the data to the first list.

If your intention is to link the two lists together, simply find the last *next pointer in your first list and point it to the head of the second list.

Some notes on your code: When traversing your lists, sometimes you compare against NULL and sometimes you compare against 0. Keep it consistent. It's probably better to always use NULL.

Your insert() method isn't really an insert method. It is an append method. It always adds the record to the end of the list. It makes more sense (to me, at least) that the insert() method should add the record just before your NewList *current pointer.

Also, your class maintains a *current pointer which will never point to anything other than *head (i.e. it's only set in insert()). *current should probably be used to keep track of the current read position in your linked list so your users can actually use the list. You need a getData() method and a next() method which would allow users to read a record and move to the next record in the list. You should also include a rewind() method to set the *current pointer back to the beginning of the list.
QuestionA Global Keyboard hook problem. Pin
emmmatty11-Sep-08 9:33
Memberemmmatty11-Sep-08 9:33 
AnswerRe: A Global Keyboard hook problem. Pin
Naveen1-Sep-08 15:21
MemberNaveen1-Sep-08 15:21 
GeneralRe: A Global Keyboard hook problem. Pin
emmmatty11-Sep-08 18:49
Memberemmmatty11-Sep-08 18:49 
GeneralRe: A Global Keyboard hook problem. Pin
Naveen1-Sep-08 19:00
MemberNaveen1-Sep-08 19:00 
AnswerRe: A Global Keyboard hook problem. Pin
Rajesh R Subramanian1-Sep-08 20:51
professionalRajesh R Subramanian1-Sep-08 20:51 
Questionrand() always returns 18467...whats going on.. [modified] Pin
montiee1-Sep-08 8:47
Membermontiee1-Sep-08 8:47 
AnswerRe: rand() always returns 18467...whats going on.. Pin
Mark Salsbery1-Sep-08 11:20
MemberMark Salsbery1-Sep-08 11:20 
GeneralRe: rand() always returns 18467...whats going on.. Pin
montiee1-Sep-08 19:23
Membermontiee1-Sep-08 19:23 
QuestionMy application is closing when i hit enter button through keyboard Pin
hariakuthota1-Sep-08 8:12
Memberhariakuthota1-Sep-08 8:12 
AnswerRe: My application is closing when i hit enter button through keyboard Pin
Cedric Moonen1-Sep-08 8:16
MemberCedric Moonen1-Sep-08 8:16 
AnswerRe: My application is closing when i hit enter button through keyboard Pin
onlyjaypatel1-Sep-08 19:24
Memberonlyjaypatel1-Sep-08 19:24 
Question3D World Pin
MrMcIntyre1-Sep-08 7:34
MemberMrMcIntyre1-Sep-08 7:34 
AnswerRe: 3D World Pin
Cedric Moonen1-Sep-08 7:50
MemberCedric Moonen1-Sep-08 7:50 
GeneralRe: 3D World Pin
MrMcIntyre1-Sep-08 8:07
MemberMrMcIntyre1-Sep-08 8:07 
GeneralRe: 3D World Pin
Cedric Moonen1-Sep-08 8:14
MemberCedric Moonen1-Sep-08 8:14 
GeneralRe: 3D World Pin
MrMcIntyre1-Sep-08 9:06
MemberMrMcIntyre1-Sep-08 9:06 
GeneralRe: 3D World Pin
El Corazon1-Sep-08 15:12
MemberEl Corazon1-Sep-08 15:12 

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.