temp = node2; <-- get something to keep track of the node we're removing
node1->next = temp->next; <-- make the node before it, point to the node after it
temp->next = NULL; <-- fix the node we're...
Type: Posts; User: tofugirl
temp = node2; <-- get something to keep track of the node we're removing
node1->next = temp->next; <-- make the node before it, point to the node after it
temp->next = NULL; <-- fix the node we're...
Since I need 3 head pointers, I need 3 nodes with data & next... hmm.. I get it. Because I'm going to loose everything if I use the same nodes & headnodes.. dammit! Thanks for the mini code quzah.
...
ptr = remove( somelist, somevalue );
add( someotherlist, ptr1 );
I'm guessing your add is same as an
insert(someotherlist, ptr1);?
I was thinking along the terms of ssharish2005's reply....
That would be too much code. It's your regular generic code of a singly-linked list.
Here is what I want to do:
1. Create a linked list
2. Create a linked list from those deleted in (1)
3. Create a linked list from those deleted in (2)
Total of 3 singly-linked lists.
1-3 have...
ok ok. I will try to turn in something. I did what Quzah suggested btw. I just have too many bugs.
Maybe I'll go at a 'different angle' as you suggest.. then go at a different angle if that...
Jverkoey,
I understand what recursion is. I can trace-through code, and tell you what it outputs. I just cannot figure out code for myself. btw - I'm the 'recursive word search' post. my...
Sooooo... I have a programming 'grade opinion' to ask.
I hate recursion. I don't get it, don't like it, and hate it. If I have to do it, I'll do it.
If say.. I have a pretty good grade in my...
No worries. Oh, and to pull this back on track:
You could make your recursive function return 1 + the other recursive calls, and 0 on failure. If the total returned equals the length of the word...
Ahhh! It is the return of the Word Search!!! :eek: However, any ideas on how to do it recursively?
for instance:
n t o f u g i r l
h n d d c s e r c
e e b d u c s f e...
Thanks for all your suggestions. I went with jmd15's answer. It works now.
A big thank you!
Do you perhaps have a code snippet for this? I tried to do that but I'm getting core dumps. Here's my code.
char *name, *origname;
FILE *ofp;
printf("Please enter name\n");
...
I get a name from the user and output it to a file "name.txt". For instance, if the user entered 'tofugirl' I write to a file called "tofugirl.txt". However, how would I get "name" ("tofugirl") back...