Click here to Skip to main content
15,849,494 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionTCF Eclipse users please reply Pin
Vaclav_20-Sep-17 14:39
Vaclav_20-Sep-17 14:39 
AnswerRe: TCF Eclipse users please reply Pin
Richard MacCutchan20-Sep-17 22:31
mveRichard MacCutchan20-Sep-17 22:31 
GeneralRe: TCF Eclipse users please reply Pin
Vaclav_21-Sep-17 14:06
Vaclav_21-Sep-17 14:06 
GeneralRe: TCF Eclipse users please reply Pin
Richard MacCutchan21-Sep-17 22:00
mveRichard MacCutchan21-Sep-17 22:00 
QuestionDoubly Linked List Pin
kinderu17-Sep-17 0:17
kinderu17-Sep-17 0:17 
AnswerRe: Doubly Linked List Pin
Richard MacCutchan17-Sep-17 2:49
mveRichard MacCutchan17-Sep-17 2:49 
AnswerRe: Doubly Linked List Pin
leon de boer17-Sep-17 5:42
leon de boer17-Sep-17 5:42 
AnswerRe: Doubly Linked List Pin
Jochen Arndt17-Sep-17 22:45
professionalJochen Arndt17-Sep-17 22:45 
Your NODE class does not initialise the next and previous members in the constructor. You are initialising them in your DoublyLinkedList class when adding a node. But so valid states depend on that which is dangerous and bad style. You should initialise them in the constructor to ensure that they contain always a defined value.

You are allocating your objects on the stack but in DeleteNODE you call delete. Sou you should allocate them on the heap instead:
NODE *obj1 = new NODE("Dragu", "Stelian", "1911226284570", "dragu_stelian@yahoo.com");
ptr->AddNODE(obj1);
To avoid such wrong allocation, a linked list implementation usually does the allocation (e.g. by not passing an existing object to the add function but the data and let the implementation do the allocation):
C++
void DoublyLinkedList::AddNODE(const Persons& person)
{
    // Requires a constructor that accepts a Persons reference
    NODE *newNode = new NODE(person);
    // ...
}


There is also no need to use heap allocation for the box member (which is never getting deleted in your implementation). Just use the structure as member.

Instead of finding the reason of your crash I suggest to rethink your design. There are plenty of examples.
QuestionSolution access internet by proxy server c++ Pin
Con Cop Con13-Sep-17 20:22
Con Cop Con13-Sep-17 20:22 
AnswerRe: Solution access internet by proxy server c++ Pin
jschell18-Sep-17 13:32
jschell18-Sep-17 13:32 
QuestionLinker error Pin
Vaclav_12-Sep-17 16:53
Vaclav_12-Sep-17 16:53 
AnswerRe: Linker error Pin
Richard MacCutchan12-Sep-17 20:12
mveRichard MacCutchan12-Sep-17 20:12 
AnswerRe: Linker error Pin
CPallini13-Sep-17 2:25
mveCPallini13-Sep-17 2:25 
GeneralRe: Linker error Pin
Vaclav_13-Sep-17 4:14
Vaclav_13-Sep-17 4:14 
GeneralRe: Linker error Pin
leon de boer13-Sep-17 5:02
leon de boer13-Sep-17 5:02 
GeneralRe: Linker error Pin
jschell13-Sep-17 9:23
jschell13-Sep-17 9:23 
AnswerRe: Linker error Pin
Jochen Arndt13-Sep-17 5:14
professionalJochen Arndt13-Sep-17 5:14 
GeneralRe: Linker error Pin
Vaclav_13-Sep-17 10:05
Vaclav_13-Sep-17 10:05 
GeneralRe: Linker error Pin
Jochen Arndt14-Sep-17 4:38
professionalJochen Arndt14-Sep-17 4:38 
GeneralRe: Linker error Pin
leon de boer15-Sep-17 23:21
leon de boer15-Sep-17 23:21 
GeneralRe: Linker error Pin
Vaclav_16-Sep-17 4:02
Vaclav_16-Sep-17 4:02 
GeneralRe: Linker error Pin
leon de boer16-Sep-17 4:16
leon de boer16-Sep-17 4:16 
QuestionClarification of Debug/Release mode Pin
ForNow11-Sep-17 3:24
ForNow11-Sep-17 3:24 
AnswerRe: Clarification of Debug/Release mode Pin
Jochen Arndt11-Sep-17 4:21
professionalJochen Arndt11-Sep-17 4:21 
AnswerRe: Clarification of Debug/Release mode Pin
leon de boer11-Sep-17 16:51
leon de boer11-Sep-17 16:51 

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.