Click here to Skip to main content
15,914,163 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: About Multicast. Help Pin
Mark Salsbery31-Mar-07 6:37
Mark Salsbery31-Mar-07 6:37 
QuestionSTARTTLS Command Pin
neha.agarwal2730-Mar-07 1:49
neha.agarwal2730-Mar-07 1:49 
QuestionUsing WebService in C++ Pin
Tyler4530-Mar-07 1:41
Tyler4530-Mar-07 1:41 
AnswerRe: Using WebService in C++ Pin
Programm3r30-Mar-07 1:55
Programm3r30-Mar-07 1:55 
AnswerRe: Using WebService in C++ Pin
Tyler4530-Mar-07 2:31
Tyler4530-Mar-07 2:31 
Questionlinked list problem Pin
neha.agarwal2730-Mar-07 1:33
neha.agarwal2730-Mar-07 1:33 
AnswerRe: linked list problem Pin
Cedric Moonen30-Mar-07 1:44
Cedric Moonen30-Mar-07 1:44 
AnswerRe: linked list problem [modified] Pin
CPallini30-Mar-07 1:59
mveCPallini30-Mar-07 1:59 
MOdified: according to Cedric Moonen the next of the last node has to be set to NULL.

You linked a node to itself. Change the function
neha.agarwal27 wrote:
void insert()
{
  node *temp = new node;
  start_ptr = temp;
  for(int i = 0;i<3;i++)
  {
    cout<<"\n enter the name ";
    cin>>temp->str;
    temp->nxt = temp;
    temp = temp->nxt;
  }
}



into:

void insert()
{	
  node *temp;
  node *prev = NULL;
  
  for(int i = 0;i<3;i++)
  {
    temp = new node;
    if (  prev )
    {
      prev->next = temp;
    }
    else
    {
      start_ptr = temp
    }

    cout<<"\n enter the name ";
    cin>>temp->str;
    prev = temp;
  }
  temp->next=NULL;
}



I have NOT made a test, but it should work...
Smile | :)



-- modified at 8:26 Friday 30th March, 2007


-- modified at 8:29 Friday 30th March, 2007

If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.

GeneralRe: linked list problem Pin
neha.agarwal2730-Mar-07 2:13
neha.agarwal2730-Mar-07 2:13 
GeneralRe: linked list problem Pin
Cedric Moonen30-Mar-07 2:19
Cedric Moonen30-Mar-07 2:19 
GeneralRe: linked list problem Pin
neha.agarwal2730-Mar-07 2:27
neha.agarwal2730-Mar-07 2:27 
QuestionRe: linked list problem Pin
Maximilien30-Mar-07 3:21
Maximilien30-Mar-07 3:21 
AnswerRe: linked list problem Pin
Christian Graus30-Mar-07 3:31
protectorChristian Graus30-Mar-07 3:31 
AnswerRe: linked list problem Pin
ThatsAlok1-Apr-07 21:00
ThatsAlok1-Apr-07 21:00 
QuestionDisabling Controls Pin
gunner_uk200030-Mar-07 1:10
gunner_uk200030-Mar-07 1:10 
AnswerRe: Disabling Controls Pin
Naveen30-Mar-07 1:18
Naveen30-Mar-07 1:18 
GeneralRe: Disabling Controls Pin
gunner_uk200030-Mar-07 1:22
gunner_uk200030-Mar-07 1:22 
GeneralRe: Disabling Controls [modified] Pin
Naveen30-Mar-07 1:31
Naveen30-Mar-07 1:31 
AnswerRe: Disabling Controls Pin
gunner_uk200030-Mar-07 1:34
gunner_uk200030-Mar-07 1:34 
GeneralRe: Disabling Controls [modified] Pin
Naveen30-Mar-07 1:48
Naveen30-Mar-07 1:48 
AnswerRe: Disabling Controls Pin
prasad_som30-Mar-07 1:48
prasad_som30-Mar-07 1:48 
GeneralRe: Disabling Controls Pin
gunner_uk200030-Mar-07 1:52
gunner_uk200030-Mar-07 1:52 
Questionatl8.0 backward compatibility issue Pin
Shiva Prasad30-Mar-07 1:09
Shiva Prasad30-Mar-07 1:09 
AnswerRe: atl8.0 backward compatibility issue Pin
prasad_som30-Mar-07 3:29
prasad_som30-Mar-07 3:29 
Question"Additional include directories" problem Pin
Aredel30-Mar-07 0:28
Aredel30-Mar-07 0:28 

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.