Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/articles/c-tutorials/)
-   -   Circular linked list (http://www.go4expert.com/articles/circular-linked-list-t1282/)

harris 3Mar2009 13:14

Re: Circular linked list
 
Well, i need a similar sample for my assignement (not really mine but have to do it) but what i found in the internet, most of them are not working with the blood dev c so it's really difficult for me to work it out.. think ya can help me out??

shabbir 3Mar2009 14:45

Re: Circular linked list
 
Quote:

Originally Posted by harris (Post 43759)
Well, i don't usually pop out with this kind of thing but i need it urgent and using blood dev C is really pain in the ar5e.. i tried your progam but it's not working, something is wrong with your do while statement, it's infinite loop..

I am not sure which while loop or function you are referring to but all of them as of the following format

Code:

while(current->next!=start)
which cannot be a infinite one.

Also I ran the program as well and it works perfectly fine on VC++ 6 Environment.

harris 3Mar2009 18:37

Re: Circular linked list
 
Quote:

Originally Posted by shabbir (Post 43766)
I am not sure which while loop or function you are referring to but all of them as of the following format

Code:

while(current->next!=start)
which cannot be a infinite one.

Also I ran the program as well and it works perfectly fine on VC++ 6 Environment.

It's
Code:

While (ch=='Y' || ch=='y');
When i choose 'y', there forever looping.. Well, I tried it in blood dev c environment...

shabbir 3Mar2009 18:46

Re: Circular linked list
 
Choose something else and it would break :D

harris 3Mar2009 19:25

Re: Circular linked list
 
I know about that, i didn't choose anything else.. I chose 'y' and it's not working.. My software is blood dev c so it's really difficult for me to work it out from the sample as it's not working when i tried it.. And ya can call this stuck.. Well, btw, if ya got free time or ya're bored, ya can try that assignment, think it as a lil bit of practise or whatever.. :nice:

shabbir 3Mar2009 20:28

Re: Circular linked list
 
The try Flushing the variable before the input

pandaren23 5Mar2009 13:17

Re: Circular linked list
 
@harris
The program is perfect. Maybe you might just have placed a character value on the roll number or at the mark then it would of course result into an infinite loop.

by the way.. the program was good.. ^_^ it would help me a lot in my machine problem.. thanks for the upload. :p

harris 5Mar2009 14:46

Re: Circular linked list
 
Quote:

Originally Posted by shabbir (Post 43797)
The try Flushing the variable before the input

Very good, it works!! Thank ya m8.. :happy:

shabbir 5Mar2009 14:51

Re: Circular linked list
 
Quote:

Originally Posted by harris (Post 43972)
Very good, it works!! Thank ya m8.. :happy:

The pleasure is all mine.

harris 5Mar2009 16:07

Re: Circular linked list
 
Btw, can ya give me some pointer?? i wanna to limit the queue for just 5.. Yours one seems like no limit there..


All times are GMT +5.5. The time now is 23:33.