@@ ListFuns.c @@

Reply

Join Date: Mar 2006
Posts: 4
Reputation: minorityreport is an unknown quantity at this point 
Solved Threads: 0
minorityreport minorityreport is offline Offline
Newbie Poster

@@ ListFuns.c @@

 
0
  #1
Mar 12th, 2006
Hi,

Can anyone tell me if i have done these functions correctly; i maybe missing something; maybe thats why im getting segmentation fault!!!

#include "listFuns.h"
#include <stdlib.h>
#include <stdio.h>

listADT stringToList(char str[])
/* desc: converts a C string (array of char) into the */
/* corresponding word (list of characters) */
{
listADT temp;
return temp;
}

void displayList(listADT list)
{
if(!isEmptyList(list))
{ // if the list is not empty
printf("%c", headList(list)); // print the character at the current head of the list
displayList(tailList(list)); // call the function again with the next character in the list
}
printf("\n"); //print a new line

}

boolean precedesList(listADT list1, listADT list2)
/* desc: returns TRUE if the word in list1 is alphabetically */
/* before that in list2 */
{
return FALSE;
}
boolean equalsList(listADT list1, listADT list2)
/* desc: returns TRUE if the word in list1 is equal to that */
/* in list2 */
{
return FALSE;
}
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 7,614
Reputation: Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute 
Solved Threads: 713
Team Colleague
Narue's Avatar
Narue Narue is offline Offline
Code Goddess

Re: @@ ListFuns.c @@

 
0
  #2
Mar 12th, 2006
You'll get no help by posting partial code and complaining of a vague segmentation fault. If you don't clarify your posts, I'll remove them as spam. Also, for the same problem, keep your posts to a single thread.
I'm here to prove you wrong.
Reply With Quote Quick reply to this message  
Join Date: Mar 2006
Posts: 4
Reputation: minorityreport is an unknown quantity at this point 
Solved Threads: 0
minorityreport minorityreport is offline Offline
Newbie Poster

Re: @@ ListFuns.c @@

 
0
  #3
Mar 12th, 2006
hi, i am sorry for being so broad; i am simply debugging and looking for possibilities myself of why i keep getting segmentation fault!

i am new to this forum; thanks for advicing me on the do's and dont's; i looked at the listfuns.c and thought i might be missing something from the instruction.

can you advise me where i may have gone wrong?

thanks
Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 2,039
Reputation: Rashakil Fol is just really nice Rashakil Fol is just really nice Rashakil Fol is just really nice Rashakil Fol is just really nice 
Solved Threads: 139
Team Colleague
Rashakil Fol's Avatar
Rashakil Fol Rashakil Fol is offline Offline
Super Senior Demiposter

Re: @@ ListFuns.c @@

 
0
  #4
Mar 13th, 2006
Um, why would you even expect this code to work? Do equalsList, precedesList, and stringToList work as advertised?
All my posts may be redistributed under the GNU Free Documentation License.
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 7,614
Reputation: Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute 
Solved Threads: 713
Team Colleague
Narue's Avatar
Narue Narue is offline Offline
Code Goddess

Re: @@ ListFuns.c @@

 
0
  #5
Mar 13th, 2006
>can you advise me where i may have gone wrong?
All of the code you've posted consists of either statements that cannot cause a seg fault, or user-defined function calls. The only conclusion is that the fault is in one of those functions, but because you haven't posted the code for any of them, we can't help you. This isn't a difficult concept.
I'm here to prove you wrong.
Reply With Quote Quick reply to this message  
Join Date: Mar 2006
Posts: 4
Reputation: minorityreport is an unknown quantity at this point 
Solved Threads: 0
minorityreport minorityreport is offline Offline
Newbie Poster

Re: @@ ListFuns.c @@

 
0
  #6
Mar 13th, 2006
hi, i have got the programme working;
thanks
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 7,614
Reputation: Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute 
Solved Threads: 713
Team Colleague
Narue's Avatar
Narue Narue is offline Offline
Code Goddess

Re: @@ ListFuns.c @@

 
0
  #7
Mar 13th, 2006
>i have got the programme working
And? I'm quickly beginning to think you're a troll. First you post code that can't be debugged due to lack of information, then you say you've fixed the problem but don't bother to tell us where or what it was.
I'm here to prove you wrong.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC