Thanks for your help mate - I've actually got it adding to the content list OK now, but with the problem I mentioned about the files being added to the wrong directory. The files are added to the...
Type: Posts; User: thoseion
Thanks for your help mate - I've actually got it adding to the content list OK now, but with the problem I mentioned about the files being added to the wrong directory. The files are added to the...
I've tried simply adding to lp->content instead of the main list, and it appears to work OK in that when I print the main list, no filenames are printed. But I keep getting a seg fault when trying...
The sections that use stat were actually given to me like that, along with the code fragment you've highlighted. Surely that code can return something other than 0? If s = ".." then it will fail...
I'm attempting to write a program whereby it gets the name and path of all directories and files and adds them to a linked list. The list structure should hold the name/path for a directory, then...
I believe the problem is due to a simple variable naming error - you've named your character array val3 but when you send it to AddToList, your actually sending val2.
OMG!! That missing '=' was the problem all along! Can't believe I've spent the best part of a whole day trying to get that working and it was because I missed out an operator!
Thanks a lot for...
Yeah, I had it commented out while I was error checking (pretty much clutching at straws trying to find out what was going wrong!) , I didn't mean to leave it in the code I posted.
I've edited my...
Hi mate, I've edited it as per your suggestions but it still crashes as soon as I run the program :(
Nearly there with getting this program finished but I've run into another problem - my program keeps crashing after trying to implement a merge sort. It all compiles OK but crashes as soon as I run...
lol nevermind - after posting the thread I noticed I was missing the "==0" in the line "if (strcmp(ptr->words, word) == 0){" :p
Thanks to Prelude, I've nearly got my program doing what it's meant to - just have one more annoying problem that I'm sure is down to my simple stupidity...
I am trying to add words from a...
I'm new to C programming and so I'm having some problems with a simple program I'm trying to code. Essentially I'm trying to read in a text file, store the individual words into a linked list, then...