LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-14-2003, 12:20 AM   #1
jetfreggel
Member
 
Registered: May 2002
Posts: 172

Rep: Reputation: 30
book linked list in C


Does anyone knows a good book dealing with linked list
i am writing a liinked t but i ran into some trouble

language C
 
Old 03-14-2003, 12:28 AM   #2
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
I don't know if there's a good book specifically for linked lists, but I learned C with the textbook "C By Dissection". As far as I can remember, it was pretty good.

What kind of problem are you having? I've written a few programs that use linked lists...
 
Old 03-14-2003, 12:40 AM   #3
jetfreggel
Member
 
Registered: May 2002
Posts: 172

Original Poster
Rep: Reputation: 30
thx for the reply the trouble is want to read data from a file into linked list (no prob)
the i want to do a match strstr()(no prob)
but the i want wath i matched put into a temporary list
so i can do some aother function
i want to post my code but i am at work and typing it out of head is no option when i return at my home i will post if nessecary
 
Old 03-14-2003, 12:44 AM   #4
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
Yeah, I'd need to see the code to understand what you're trying to do.

I doubt it will take long to get you on the right track...
 
Old 03-14-2003, 12:47 AM   #5
jetfreggel
Member
 
Registered: May 2002
Posts: 172

Original Poster
Rep: Reputation: 30
thx man
 
Old 03-14-2003, 12:59 AM   #6
GtkUser
Member
 
Registered: Sep 2002
Location: Canada
Distribution: Redhat 9.0
Posts: 637

Rep: Reputation: 30
Sound like traversing a linked list, and removing nodes from the middle of the list. I have done that before, a long time ago.
 
Old 03-14-2003, 01:01 AM   #7
jetfreggel
Member
 
Registered: May 2002
Posts: 172

Original Poster
Rep: Reputation: 30
is it possible instead of reemoving copying the matches to a tmp
linked list
 
Old 03-14-2003, 01:05 AM   #8
GtkUser
Member
 
Registered: Sep 2002
Location: Canada
Distribution: Redhat 9.0
Posts: 637

Rep: Reputation: 30
Do you want all the matched nodes in a separate list or just have them discarded? Either way it's possible. You would have to deallocate the node memory if you wanted to get rid of it, or else add it to the new list.
 
Old 03-14-2003, 01:46 AM   #9
jetfreggel
Member
 
Registered: May 2002
Posts: 172

Original Poster
Rep: Reputation: 30
i want to put them in a seperate linked list
is it also possible to edit something
like the user performs a search and then
edit the search with backspace arrows and typing new data
like a text editor o like a shell where you can edit your command when you typed it in
 
Old 03-14-2003, 02:05 AM   #10
GtkUser
Member
 
Registered: Sep 2002
Location: Canada
Distribution: Redhat 9.0
Posts: 637

Rep: Reputation: 30
There is a '\b' character that can be used in your code in a condition test.
 
Old 03-14-2003, 02:12 AM   #11
jetfreggel
Member
 
Registered: May 2002
Posts: 172

Original Poster
Rep: Reputation: 30
can you give an example
i don't get it
 
Old 03-14-2003, 02:24 AM   #12
GtkUser
Member
 
Registered: Sep 2002
Location: Canada
Distribution: Redhat 9.0
Posts: 637

Rep: Reputation: 30
Not really because I don't clearly know what kind of functionality that you want. I was thinking:

if ( getchar() == '\b' )
//move array index back one place?

However without your code, I'm lost.
 
Old 03-14-2003, 02:43 AM   #13
jetfreggel
Member
 
Registered: May 2002
Posts: 172

Original Poster
Rep: Reputation: 30
fuctionality if you typed an author or example that you can edit like
you do in bash with your arrows
if i typed R. Richard Stevens
and it supposed to be W. Richard stevens
take your key go to the first R backspace or delete and
put the new letter
like you would edit a command in your bash when you et it out of your HISTFILE and you edit it for another purpose
 
Old 03-14-2003, 09:23 AM   #14
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
Again, for Gtk or I to give you good information, we'd need to see some source.

However, let me say this. You've already got the code to support your file-based linked list. Why not use that foundation of code to support another linked list? There's no rule that says you can only have one linked list in a program. For the first list, you created a node for every line of the file. For the second list, create a node for each "match" you find in your original.
 
Old 03-16-2003, 10:52 AM   #15
jetfreggel
Member
 
Registered: May 2002
Posts: 172

Original Poster
Rep: Reputation: 30
thx guys already found it
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
concepts a linked list program in c ssg14j Programming 4 08-19-2005 10:10 AM
C++ Linked List question lowpro2k3 Programming 3 06-16-2005 10:15 AM
linked list + c dilberim82 Programming 5 05-04-2005 11:48 PM
cirular linked list pantera Programming 8 04-21-2005 06:59 AM
C++ linked list fun chens_83 Programming 2 08-04-2003 07:40 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:58 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration